]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-if-conv.c (find_phi_replacement_condition): Unshare "*cond" before forcing it...
authorRichard Guenther <rguenther@suse.de>
Mon, 16 Jul 2007 19:55:17 +0000 (19:55 +0000)
committerUros Bizjak <uros@gcc.gnu.org>
Mon, 16 Jul 2007 19:55:17 +0000 (21:55 +0200)
        * tree-if-conv.c (find_phi_replacement_condition): Unshare "*cond"
        before forcing it to gimple operand.

Co-Authored-By: Uros Bizjak <ubizjak@gmail.com>
From-SVN: r126690

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

index 172a189c8a275e69e738f4e23d2da4a26a56b02f..c55224baf69f3a234d5dd8e16733023f1d13bacb 100644 (file)
@@ -1,3 +1,9 @@
+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-13  Paolo Bonzini  <bonzini@gnu.org>
 
        Revert these patches:
index 006d3dba23bfac4700db6237c6732dfc17878ce1..18e6de50e240d60b01771c72e1a5cc8772bf28b5 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))