]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: tree-if-conv.c (find_phi_replacement_condition): Unshare "*cond" before...
authorRichard Guenther <rguenther@suse.de>
Tue, 24 Jul 2007 12:30:10 +0000 (12:30 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 24 Jul 2007 12:30:10 +0000 (12:30 +0000)
2007-07-24  Richard Guenther  <rguenther@suse.de>

        Backport from mainline:
        2007-07-16  Richard Guenther  <rguenther@suse.de>
                    Uros Bizjak  <ubizjak@gmail.com>

        * tree-if-conv.c (find_phi_replacement_condition): Unshare
        "*cond" before forcing it to gimple operand.

From-SVN: r126874

gcc/ChangeLog
gcc/tree-if-conv.c

index 774fca1d3725e5e9ff6a8e211b3b6546d6bd94dc..d566216059333652de966a42707ec5603e949b00 100644 (file)
@@ -1,3 +1,12 @@
+2007-07-24  Richard Guenther  <rguenther@suse.de>
+
+       Backport from mainline:
+       2007-07-16  Richard Guenther  <rguenther@suse.de>
+                   Uros Bizjak  <ubizjak@gmail.com>
+
+       * tree-if-conv.c (find_phi_replacement_condition): Unshare "*cond"
+       before forcing it to gimple operand.
+
 2007-07-24  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/32723
index 5b4a9a33c0be0547db56168cf23d96b44dd9a951..722721ade9299f659bc35564c094afc955a2c23c 100644 (file)
@@ -743,7 +743,7 @@ find_phi_replacement_condition (struct loop *loop,
       if (TREE_CODE (*cond) == TRUTH_NOT_EXPR)
        /* We can be smart here and choose inverted
           condition without switching bbs.  */
-         *cond = invert_truthvalue (*cond);
+       *cond = invert_truthvalue (*cond);
       else
        /* Select non loop header bb.  */
        first_edge = second_edge;
@@ -762,9 +762,11 @@ find_phi_replacement_condition (struct loop *loop,
 
   /* Create temp. for the condition. Vectorizer prefers to have gimple
      value as condition. Various targets use different means to communicate
-     condition in vector compare operation. Using gimple value allows compiler
-     to emit vector compare and select RTL without exposing compare's result.  */
-  *cond = force_gimple_operand (*cond, &new_stmts, false, NULL_TREE);
+     condition in vector compare operation. Using gimple value allows
+     compiler to emit vector compare and select RTL without exposing
+     compare's result.  */
+  *cond = force_gimple_operand (unshare_expr (*cond), &new_stmts,
+                               false, NULL_TREE);
   if (new_stmts)
     bsi_insert_before (bsi, new_stmts, BSI_SAME_STMT);
   if (!is_gimple_reg (*cond) && !is_gimple_condexpr (*cond))