re PR tree-optimization/26264 (Extraneous warning with __builtin_stdarg_start and optimization)

2008-02-26  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

	PR 26264
	* builtins.def (BUILT_IN_STDARG_START): Remove.
	* builtins.c (expand_builtin): Remove BUILT_IN_STDARG_START.
	* tree-stdarg.c (execute_optimize_stdarg): Likewise.
	* tree-inline.c (inline_forbidden_p_1): Likewise.
cp/
	* call.c (magic_varargs_p):  Remove BUILT_IN_STDARG_START.
testsuite/
	* 20021023-1.c: Use __builtin_va_start instead of
	__builtin_stdarg_start.
	* pr17301-1.c: Likewise.
	* pr17301-2.c: Likewise.

From-SVN: r132677
This commit is contained in:
Manuel López-Ibáñez 2008-02-26 14:16:13 +00:00
parent bbd59cf423
commit 4f01eeb4b5
11 changed files with 26 additions and 10 deletions

View File

@ -1,3 +1,11 @@
2008-02-26 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR 26264
* builtins.def (BUILT_IN_STDARG_START): Remove.
* builtins.c (expand_builtin): Remove BUILT_IN_STDARG_START.
* tree-stdarg.c (execute_optimize_stdarg): Likewise.
* tree-inline.c (inline_forbidden_p_1): Likewise.
2008-02-26 Richard Guenther <rguenther@suse.de>
* tree-flow.h (uid_decl_map_hash, uid_decl_map_eq): Move ...

View File

@ -6702,7 +6702,6 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
return expand_builtin_extend_pointer (CALL_EXPR_ARG (exp, 0));
case BUILT_IN_VA_START:
case BUILT_IN_STDARG_START:
return expand_builtin_va_start (exp);
case BUILT_IN_VA_END:
return expand_builtin_va_end (exp);

View File

@ -693,7 +693,6 @@ DEF_GCC_BUILTIN (BUILT_IN_RETURN, "return", BT_FN_VOID_PTR, ATTR_NORETURN
DEF_GCC_BUILTIN (BUILT_IN_RETURN_ADDRESS, "return_address", BT_FN_PTR_UINT, ATTR_NULL)
DEF_GCC_BUILTIN (BUILT_IN_SAVEREGS, "saveregs", BT_FN_PTR_VAR, ATTR_NULL)
DEF_GCC_BUILTIN (BUILT_IN_SETJMP, "setjmp", BT_FN_INT_PTR, ATTR_NULL)
DEF_GCC_BUILTIN (BUILT_IN_STDARG_START, "stdarg_start", BT_FN_VOID_VALIST_REF_VAR, ATTR_NULL)
DEF_EXT_LIB_BUILTIN (BUILT_IN_STRFMON, "strfmon", BT_FN_SSIZE_STRING_SIZE_CONST_STRING_VAR, ATTR_FORMAT_STRFMON_NOTHROW_3_4)
DEF_LIB_BUILTIN (BUILT_IN_STRFTIME, "strftime", BT_FN_SIZE_STRING_SIZE_CONST_STRING_CONST_PTR, ATTR_FORMAT_STRFTIME_NOTHROW_3_0)
DEF_GCC_BUILTIN (BUILT_IN_TRAP, "trap", BT_FN_VOID, ATTR_NORETURN_NOTHROW_LIST)

View File

@ -1,3 +1,8 @@
2008-02-26 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR 26264
* call.c (magic_varargs_p): Remove BUILT_IN_STDARG_START.
2008-02-26 Richard Guenther <rguenther@suse.de>
* decl.c (duplicate_decls): Remove decl from global mapping

View File

@ -4826,7 +4826,6 @@ magic_varargs_p (tree fn)
case BUILT_IN_CLASSIFY_TYPE:
case BUILT_IN_CONSTANT_P:
case BUILT_IN_NEXT_ARG:
case BUILT_IN_STDARG_START:
case BUILT_IN_VA_START:
return true;

View File

@ -1,3 +1,11 @@
2008-02-26 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR 26264
* 20021023-1.c: Use __builtin_va_start instead of
__builtin_stdarg_start.
* pr17301-1.c: Likewise.
* pr17301-2.c: Likewise.
2008-02-26 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
* gcc.dg/pr34351.c: New.

View File

@ -17,7 +17,7 @@ bar (void *a, float b, const char *c, ...)
va_list args;
unsigned int d;
__builtin_stdarg_start (args, c);
__builtin_va_start (args, c);
d = foo (a, b, c, args, a);
__builtin_va_end (args);
return d;

View File

@ -1,4 +1,4 @@
/* Invalid use of __builtin_stdarg_start should not cause an ICE. Bug
/* Invalid use of __builtin_va_start should not cause an ICE. Bug
17301. */
/* { dg-do compile } */
/* { dg-options "" } */
@ -7,5 +7,5 @@ int
write_format (char *format, ...)
{
__builtin_va_list p;
__builtin_stdarg_start (p); /* { dg-error "too few arguments to function 'va_start'" } */
__builtin_va_start (p); /* { dg-error "too few arguments to function 'va_start'" } */
}

View File

@ -1,9 +1,9 @@
/* Invalid use of __builtin_stdarg_start should not cause an ICE. Bug
/* Invalid use of __builtin_va_start should not cause an ICE. Bug
17301. Case with no arguments. */
/* { dg-do compile } */
/* { dg-options "" } */
void foo (char *format, ...)
{
__builtin_stdarg_start (); /* { dg-error "too few arguments to function '__builtin_stdarg_start'" } */
__builtin_va_start (); /* { dg-error "too few arguments to function '__builtin_va_start'" } */
}

View File

@ -1899,7 +1899,6 @@ inline_forbidden_p_1 (tree *nodep, int *walk_subtrees ATTRIBUTE_UNUSED,
/* We cannot inline functions that take a variable number of
arguments. */
case BUILT_IN_VA_START:
case BUILT_IN_STDARG_START:
case BUILT_IN_NEXT_ARG:
case BUILT_IN_VA_END:
inline_forbidden_reason

View File

@ -648,7 +648,6 @@ execute_optimize_stdarg (void)
break;
/* If old style builtins are used, don't optimize anything. */
case BUILT_IN_SAVEREGS:
case BUILT_IN_STDARG_START:
case BUILT_IN_ARGS_INFO:
case BUILT_IN_NEXT_ARG:
va_list_escapes = true;