aboutsummaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@codesourcery.com>2010-10-09 00:44:46 +0000
committerNathan Froyd <froydnj@gcc.gnu.org>2010-10-09 00:44:46 +0000
commit8897c9ce64705907e7e27c649f49ea460b14538a (patch)
tree7c194c8538b6c75a36092e6f52f7bbec37a4a7b7 /gcc/builtins.c
parent5bdf87425600957aed8c6b02ac7289ef6abd203a (diff)
downloadgcc-8897c9ce64705907e7e27c649f49ea460b14538a.zip
gcc-8897c9ce64705907e7e27c649f49ea460b14538a.tar.gz
gcc-8897c9ce64705907e7e27c649f49ea460b14538a.tar.bz2
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
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 0579f75..1764cb4 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -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)