summaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorKazu Hirata <kazu@cs.umass.edu>2005-03-21 14:35:08 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2005-03-21 14:35:08 +0000
commit49d1af8985e7f1a889faa67f42937b1aee354ebd (patch)
treec303459a3f6f0861fbf059f297c852a327157fb1 /gcc/gimplify.c
parent9ce921aba837a0775de9abb3ea97e57d30f25e1f (diff)
downloadgcc-49d1af8985e7f1a889faa67f42937b1aee354ebd.tar.gz
builtins.c (fold_builtin): Take decomposed arguments of CALL_EXPR.
* builtins.c (fold_builtin): Take decomposed arguments of CALL_EXPR. * fold-const.c (fold_ternary): Update a call to fold_builtin. * gimplify.c (gimplify_call_expr): Likewise. * tree-ssa-ccp.c (ccp_fold, ccp_fold_builtin): Likewise. * tree.h: Update the prototype of fold_builtin. From-SVN: r96800
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index f16ff201694..b902ce1c97f 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -1744,7 +1744,9 @@ gimplify_call_expr (tree *expr_p, tree *pre_p, bool want_value)
decl = get_callee_fndecl (*expr_p);
if (decl && DECL_BUILT_IN (decl))
{
- tree new = fold_builtin (*expr_p, !want_value);
+ tree fndecl = get_callee_fndecl (*expr_p);
+ tree arglist = TREE_OPERAND (*expr_p, 1);
+ tree new = fold_builtin (fndecl, arglist, !want_value);
if (new && new != *expr_p)
{
@@ -1758,8 +1760,6 @@ gimplify_call_expr (tree *expr_p, tree *pre_p, bool want_value)
if (DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL
&& DECL_FUNCTION_CODE (decl) == BUILT_IN_VA_START)
{
- tree arglist = TREE_OPERAND (*expr_p, 1);
-
if (!arglist || !TREE_CHAIN (arglist))
{
error ("too few arguments to function %<va_start%>");
@@ -1802,7 +1802,9 @@ gimplify_call_expr (tree *expr_p, tree *pre_p, bool want_value)
/* Try this again in case gimplification exposed something. */
if (ret != GS_ERROR && decl && DECL_BUILT_IN (decl))
{
- tree new = fold_builtin (*expr_p, !want_value);
+ tree fndecl = get_callee_fndecl (*expr_p);
+ tree arglist = TREE_OPERAND (*expr_p, 1);
+ tree new = fold_builtin (fndecl, arglist, !want_value);
if (new && new != *expr_p)
{