builtins.c (fold_call_stmt): Don't copy gimple call arguments into a temporary array.

* builtins.c (fold_call_stmt): Don't copy gimple call arguments
	into a temporary array.

From-SVN: r165213
This commit is contained in:
Nathan Froyd 2010-10-09 00:44:46 +00:00 committed by Nathan Froyd
parent 5bdf874256
commit 8897c9ce64
2 changed files with 10 additions and 11 deletions

View File

@ -1,3 +1,8 @@
2010-10-08 Nathan Froyd <froydnj@codesourcery.com>
* builtins.c (fold_call_stmt): Don't copy gimple call arguments
into a temporary array.
2010-10-08 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/45903

View File

@ -13627,26 +13627,20 @@ fold_call_stmt (gimple stmt, bool ignore)
&& !gimple_call_va_arg_pack_p (stmt))
{
int nargs = gimple_call_num_args (stmt);
tree *args = (nargs > 0
? gimple_call_arg_ptr (stmt, 0)
: &error_mark_node);
if (avoid_folding_inline_builtin (fndecl))
return NULL_TREE;
if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD)
{
return targetm.fold_builtin (fndecl, nargs,
(nargs > 0
? gimple_call_arg_ptr (stmt, 0)
: &error_mark_node), ignore);
return targetm.fold_builtin (fndecl, nargs, args, ignore);
}
else
{
if (nargs <= MAX_ARGS_TO_FOLD_BUILTIN)
{
tree args[MAX_ARGS_TO_FOLD_BUILTIN];
int i;
for (i = 0; i < nargs; i++)
args[i] = gimple_call_arg (stmt, i);
ret = fold_builtin_n (loc, fndecl, args, nargs, ignore);
}
ret = fold_builtin_n (loc, fndecl, args, nargs, ignore);
if (!ret)
ret = gimple_fold_builtin_varargs (fndecl, stmt, ignore);
if (ret)