diff options
author | kan <kan@FreeBSD.org> | 2006-08-26 21:29:10 +0000 |
---|---|---|
committer | kan <kan@FreeBSD.org> | 2006-08-26 21:29:10 +0000 |
commit | ab6c6e434e4ca0bf593007d49dee6eceb73286c0 (patch) | |
tree | 843ffc6140f66bf60562adb1bf8d3d82b9739b5e /contrib/gcc/builtins.c | |
parent | 8a6911d2bb988a943624cbf4e4041b827d9ade53 (diff) | |
download | FreeBSD-src-ab6c6e434e4ca0bf593007d49dee6eceb73286c0.zip FreeBSD-src-ab6c6e434e4ca0bf593007d49dee6eceb73286c0.tar.gz |
Gcc 3.4.6 as of 2006/08/25 #116475.
Diffstat (limited to 'contrib/gcc/builtins.c')
-rw-r--r-- | contrib/gcc/builtins.c | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/contrib/gcc/builtins.c b/contrib/gcc/builtins.c index a3e069e..2931684 100644 --- a/contrib/gcc/builtins.c +++ b/contrib/gcc/builtins.c @@ -4329,14 +4329,15 @@ static rtx expand_builtin_fputs (tree arglist, rtx target, bool unlocked) { tree len, fn; - tree fn_fputc = unlocked ? implicit_built_in_decls[BUILT_IN_FPUTC_UNLOCKED] + /* If we're using an unlocked function, assume the other unlocked + functions exist explicitly. */ + tree const fn_fputc = unlocked ? built_in_decls[BUILT_IN_FPUTC_UNLOCKED] : implicit_built_in_decls[BUILT_IN_FPUTC]; - tree fn_fwrite = unlocked ? implicit_built_in_decls[BUILT_IN_FWRITE_UNLOCKED] + tree const fn_fwrite = unlocked ? built_in_decls[BUILT_IN_FWRITE_UNLOCKED] : implicit_built_in_decls[BUILT_IN_FWRITE]; - /* If the return value is used, or the replacement _DECL isn't - initialized, don't do the transformation. */ - if (target != const0_rtx || !fn_fputc || !fn_fwrite) + /* If the return value is used, don't do the transformation. */ + if (target != const0_rtx) return 0; /* Verify the arguments in the original call. */ @@ -4397,6 +4398,11 @@ expand_builtin_fputs (tree arglist, rtx target, bool unlocked) abort (); } + /* If the replacement _DECL isn't initialized, don't do the + transformation. */ + if (!fn) + return 0; + return expand_expr (build_function_call_expr (fn, arglist), const0_rtx, VOIDmode, EXPAND_NORMAL); } @@ -4651,11 +4657,12 @@ static rtx expand_builtin_printf (tree arglist, rtx target, enum machine_mode mode, bool unlocked) { - tree fn_putchar = unlocked - ? implicit_built_in_decls[BUILT_IN_PUTCHAR_UNLOCKED] - : implicit_built_in_decls[BUILT_IN_PUTCHAR]; - tree fn_puts = unlocked ? implicit_built_in_decls[BUILT_IN_PUTS_UNLOCKED] - : implicit_built_in_decls[BUILT_IN_PUTS]; + /* If we're using an unlocked function, assume the other unlocked + functions exist explicitly. */ + tree const fn_putchar = unlocked ? built_in_decls[BUILT_IN_PUTCHAR_UNLOCKED] + : implicit_built_in_decls[BUILT_IN_PUTCHAR]; + tree const fn_puts = unlocked ? built_in_decls[BUILT_IN_PUTS_UNLOCKED] + : implicit_built_in_decls[BUILT_IN_PUTS]; const char *fmt_str; tree fn, fmt, arg; @@ -4754,10 +4761,12 @@ static rtx expand_builtin_fprintf (tree arglist, rtx target, enum machine_mode mode, bool unlocked) { - tree fn_fputc = unlocked ? implicit_built_in_decls[BUILT_IN_FPUTC_UNLOCKED] - : implicit_built_in_decls[BUILT_IN_FPUTC]; - tree fn_fputs = unlocked ? implicit_built_in_decls[BUILT_IN_FPUTS_UNLOCKED] - : implicit_built_in_decls[BUILT_IN_FPUTS]; + /* If we're using an unlocked function, assume the other unlocked + functions exist explicitly. */ + tree const fn_fputc = unlocked ? built_in_decls[BUILT_IN_FPUTC_UNLOCKED] + : implicit_built_in_decls[BUILT_IN_FPUTC]; + tree const fn_fputs = unlocked ? built_in_decls[BUILT_IN_FPUTS_UNLOCKED] + : implicit_built_in_decls[BUILT_IN_FPUTS]; const char *fmt_str; tree fn, fmt, fp, arg; |