Commit 8897c9ce by Nathan Froyd Committed by Nathan Froyd

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
parent 5bdf8742
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> 2010-10-08 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/45903 PR tree-optimization/45903
...@@ -13627,26 +13627,20 @@ fold_call_stmt (gimple stmt, bool ignore) ...@@ -13627,26 +13627,20 @@ fold_call_stmt (gimple stmt, bool ignore)
&& !gimple_call_va_arg_pack_p (stmt)) && !gimple_call_va_arg_pack_p (stmt))
{ {
int nargs = gimple_call_num_args (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)) if (avoid_folding_inline_builtin (fndecl))
return NULL_TREE; return NULL_TREE;
if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD) if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD)
{ {
return targetm.fold_builtin (fndecl, nargs, return targetm.fold_builtin (fndecl, nargs, args, ignore);
(nargs > 0
? gimple_call_arg_ptr (stmt, 0)
: &error_mark_node), ignore);
} }
else else
{ {
if (nargs <= MAX_ARGS_TO_FOLD_BUILTIN) if (nargs <= MAX_ARGS_TO_FOLD_BUILTIN)
{ ret = fold_builtin_n (loc, fndecl, args, nargs, ignore);
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);
}
if (!ret) if (!ret)
ret = gimple_fold_builtin_varargs (fndecl, stmt, ignore); ret = gimple_fold_builtin_varargs (fndecl, stmt, ignore);
if (ret) if (ret)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment