diff options
author | Kazu Hirata <kazu@cs.umass.edu> | 2005-03-21 14:35:08 +0000 |
---|---|---|
committer | Kazu Hirata <kazu@gcc.gnu.org> | 2005-03-21 14:35:08 +0000 |
commit | 49d1af8985e7f1a889faa67f42937b1aee354ebd (patch) | |
tree | c303459a3f6f0861fbf059f297c852a327157fb1 /gcc/tree-ssa-ccp.c | |
parent | 9ce921aba837a0775de9abb3ea97e57d30f25e1f (diff) | |
download | gcc-49d1af8985e7f1a889faa67f42937b1aee354ebd.zip gcc-49d1af8985e7f1a889faa67f42937b1aee354ebd.tar.gz gcc-49d1af8985e7f1a889faa67f42937b1aee354ebd.tar.bz2 |
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/tree-ssa-ccp.c')
-rw-r--r-- | gcc/tree-ssa-ccp.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index a14cf7f..9bae835 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -938,6 +938,7 @@ ccp_fold (tree stmt) if (NUM_USES (uses) != 0) { tree *orig; + tree fndecl, arglist; size_t i; /* Preserve the original values of every operand. */ @@ -947,7 +948,9 @@ ccp_fold (tree stmt) /* Substitute operands with their values and try to fold. */ replace_uses_in (stmt, NULL); - retval = fold_builtin (rhs, false); + fndecl = get_callee_fndecl (rhs); + arglist = TREE_OPERAND (rhs, 1); + retval = fold_builtin (fndecl, arglist, false); /* Restore operands to their original form. */ for (i = 0; i < NUM_USES (uses); i++) @@ -1929,7 +1932,9 @@ ccp_fold_builtin (tree stmt, tree fn) /* First try the generic builtin folder. If that succeeds, return the result directly. */ - result = fold_builtin (fn, ignore); + callee = get_callee_fndecl (fn); + arglist = TREE_OPERAND (fn, 1); + result = fold_builtin (callee, arglist, ignore); if (result) { if (ignore) @@ -1938,13 +1943,11 @@ ccp_fold_builtin (tree stmt, tree fn) } /* Ignore MD builtins. */ - callee = get_callee_fndecl (fn); if (DECL_BUILT_IN_CLASS (callee) == BUILT_IN_MD) return NULL_TREE; /* If the builtin could not be folded, and it has no argument list, we're done. */ - arglist = TREE_OPERAND (fn, 1); if (!arglist) return NULL_TREE; |