tree-ssa-ccp.c (ccp_fold): Return immediately after calling fold_unary and fold_binary.
authorKazu Hirata <kazu@cs.umass.edu>
Sun, 29 May 2005 18:28:44 +0000 (18:28 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Sun, 29 May 2005 18:28:44 +0000 (18:28 +0000)
* tree-ssa-ccp.c (ccp_fold): Return immediately after calling
fold_unary and fold_binary.

From-SVN: r100326

gcc/ChangeLog
gcc/tree-ssa-ccp.c

index 891b283d5ee8217d5ee2a5527ebd7c4130667d37..bb4a382cf5aadd1c26fc8742f26a034968e5cd5a 100644 (file)
@@ -1,3 +1,8 @@
+2005-05-29  Kazu Hirata  <kazu@cs.umass.edu>
+
+       * tree-ssa-ccp.c (ccp_fold): Return immediately after calling
+       fold_unary and fold_binary.
+
 2005-05-29  Roger Sayle  <roger@eyesopen.com>
 
        * reg-stack.c (propagate_stack): Always copy the source stack to
index 01b608bd50df0117104ba5ad5aff14ee766e1380..f3db346bf6bdc10b17ee4b5609e2ca421792d645 100644 (file)
@@ -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