aboutsummaryrefslogtreecommitdiff
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@cs.umass.edu>2005-03-21 14:35:08 +0000
commit08150b28886a2fc0a65ce89225a5bd816843b4d6 (patch)
treec303459a3f6f0861fbf059f297c852a327157fb1 /gcc/gimplify.c
parent08a6431ac9366969f1a1d408692c9a43b02ea2e3 (diff)
* 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. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@96800 138bc75d-0d04-0410-961f-82ee72b054a4
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)
{