Deleted Added
sdiff udiff text old ( 146906 ) new ( 161660 )
full compact
1/* Expand builtin functions.
2 Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
4
5This file is part of GCC.
6
7GCC is free software; you can redistribute it and/or modify it under
8the terms of the GNU General Public License as published by the Free

--- 4315 unchanged lines hidden (view full) ---

4324
4325/* If the string passed to fputs is a constant and is one character
4326 long, we attempt to transform this call into __builtin_fputc(). */
4327
4328static rtx
4329expand_builtin_fputs (tree arglist, rtx target, bool unlocked)
4330{
4331 tree len, fn;
4332 tree fn_fputc = unlocked ? implicit_built_in_decls[BUILT_IN_FPUTC_UNLOCKED]
4333 : implicit_built_in_decls[BUILT_IN_FPUTC];
4334 tree fn_fwrite = unlocked ? implicit_built_in_decls[BUILT_IN_FWRITE_UNLOCKED]
4335 : implicit_built_in_decls[BUILT_IN_FWRITE];
4336
4337 /* If the return value is used, or the replacement _DECL isn't
4338 initialized, don't do the transformation. */
4339 if (target != const0_rtx || !fn_fputc || !fn_fwrite)
4340 return 0;
4341
4342 /* Verify the arguments in the original call. */
4343 if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE))
4344 return 0;
4345
4346 /* Get the length of the string passed to fputs. If the length
4347 can't be determined, punt. */

--- 44 unchanged lines hidden (view full) ---

4392 arglist = tree_cons (NULL_TREE, string_arg, arglist);
4393 fn = fn_fwrite;
4394 break;
4395 }
4396 default:
4397 abort ();
4398 }
4399
4400 return expand_expr (build_function_call_expr (fn, arglist),
4401 const0_rtx, VOIDmode, EXPAND_NORMAL);
4402}
4403
4404/* Expand a call to __builtin_expect. We return our argument and emit a
4405 NOTE_INSN_EXPECTED_VALUE note. This is the expansion of __builtin_expect in
4406 a non-jump context. */
4407

--- 238 unchanged lines hidden (view full) ---

4646 Return 0 if a normal call should be emitted rather than transforming
4647 the function inline. If convenient, the result should be placed in
4648 TARGET with mode MODE. UNLOCKED indicates this is a printf_unlocked
4649 call. */
4650static rtx
4651expand_builtin_printf (tree arglist, rtx target, enum machine_mode mode,
4652 bool unlocked)
4653{
4654 tree fn_putchar = unlocked
4655 ? implicit_built_in_decls[BUILT_IN_PUTCHAR_UNLOCKED]
4656 : implicit_built_in_decls[BUILT_IN_PUTCHAR];
4657 tree fn_puts = unlocked ? implicit_built_in_decls[BUILT_IN_PUTS_UNLOCKED]
4658 : implicit_built_in_decls[BUILT_IN_PUTS];
4659 const char *fmt_str;
4660 tree fn, fmt, arg;
4661
4662 /* If the return value is used, don't do the transformation. */
4663 if (target != const0_rtx)
4664 return 0;
4665
4666 /* Verify the required arguments in the original call. */

--- 82 unchanged lines hidden (view full) ---

4749 Return 0 if a normal call should be emitted rather than transforming
4750 the function inline. If convenient, the result should be placed in
4751 TARGET with mode MODE. UNLOCKED indicates this is a fprintf_unlocked
4752 call. */
4753static rtx
4754expand_builtin_fprintf (tree arglist, rtx target, enum machine_mode mode,
4755 bool unlocked)
4756{
4757 tree fn_fputc = unlocked ? implicit_built_in_decls[BUILT_IN_FPUTC_UNLOCKED]
4758 : implicit_built_in_decls[BUILT_IN_FPUTC];
4759 tree fn_fputs = unlocked ? implicit_built_in_decls[BUILT_IN_FPUTS_UNLOCKED]
4760 : implicit_built_in_decls[BUILT_IN_FPUTS];
4761 const char *fmt_str;
4762 tree fn, fmt, fp, arg;
4763
4764 /* If the return value is used, don't do the transformation. */
4765 if (target != const0_rtx)
4766 return 0;
4767
4768 /* Verify the required arguments in the original call. */

--- 2277 unchanged lines hidden ---