From: Kazu Hirata Date: Sun, 29 May 2005 18:28:44 +0000 (+0000) Subject: tree-ssa-ccp.c (ccp_fold): Return immediately after calling fold_unary and fold_binary. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=615bc06a1ed8dae28697250c75183824423659cb;p=gcc.git tree-ssa-ccp.c (ccp_fold): Return immediately after calling fold_unary and fold_binary. * tree-ssa-ccp.c (ccp_fold): Return immediately after calling fold_unary and fold_binary. From-SVN: r100326 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 891b283d5ee..bb4a382cf5a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2005-05-29 Kazu Hirata + + * tree-ssa-ccp.c (ccp_fold): Return immediately after calling + fold_unary and fold_binary. + 2005-05-29 Roger Sayle * reg-stack.c (propagate_stack): Always copy the source stack to diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index 01b608bd50d..f3db346bf6b 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -849,12 +849,7 @@ ccp_fold (tree stmt) op0 = get_value (op0, true)->value; } - retval = fold_unary (code, TREE_TYPE (rhs), op0); - - /* If we folded, but did not create an invariant, then we can not - use this expression. */ - if (retval && ! is_gimple_min_invariant (retval)) - return NULL; + return fold_unary (code, TREE_TYPE (rhs), op0); } /* Binary and comparison operators. We know one or both of the @@ -885,12 +880,7 @@ ccp_fold (tree stmt) op1 = val->value; } - retval = fold_binary (code, TREE_TYPE (rhs), op0, op1); - - /* If we folded, but did not create an invariant, then we can not - use this expression. */ - if (retval && ! is_gimple_min_invariant (retval)) - return NULL; + return fold_binary (code, TREE_TYPE (rhs), op0, op1); } /* We may be able to fold away calls to builtin functions if their