OSDN Git Service

* tree-ssa-ccp.c (ccp_fold): Return immediately after calling
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 29 May 2005 18:28:44 +0000 (18:28 +0000)
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 29 May 2005 18:28:44 +0000 (18:28 +0000)
fold_unary and fold_binary.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100326 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 891b283..bb4a382 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 01b608b..f3db346 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