PR tree-optimization/66926,66951
authorYuri Rumyantsev <ysrumyan@gmail.com>
Thu, 23 Jul 2015 11:13:00 +0000 (11:13 +0000)
committerIlya Enkovich <ienkovich@gcc.gnu.org>
Thu, 23 Jul 2015 11:13:00 +0000 (11:13 +0000)
gcc/

PR tree-optimization/66926,66951
* tree-vect-loop-manip.c (slpeel_tree_peel_loop_to_edge): Delete
INNER_LOOP and fix up condition for renaming virtual operands.

gcc/testsuite/

PR tree-optimization/66926,66951
* gcc.dg/vect/pr66951.c: New test.

From-SVN: r226103

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/pr66951.c [new file with mode: 0644]
gcc/tree-vect-loop-manip.c

index 28538ab30852fa15bb595f0336f327c99a9ca48e..6e1b53e988cb78673d3838e0e25a837748d49479 100644 (file)
@@ -1,3 +1,9 @@
+2015-07-23  Yuri Rumyantsev  <ysrumyan@gmail.com>
+
+       PR tree-optimization/66926,66951
+       * tree-vect-loop-manip.c (slpeel_tree_peel_loop_to_edge): Delete
+       INNER_LOOP and fix up condition for renaming virtual operands.
+
 2015-07-23  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        * combine.c (try_combine): Use std::swap instead of manually
index fe273a8d861c128b61011f6bbf8690309b46369d..6f3310361c88f75cfda0d37d51be5785fc39a62d 100644 (file)
@@ -1,3 +1,8 @@
+2015-07-23  Yuri Rumyantsev  <ysrumyan@gmail.com>
+
+       PR tree-optimization/66926,66951
+       * gcc.dg/vect/pr66951.c: New test.
+
 2015-07-23  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/52987
diff --git a/gcc/testsuite/gcc.dg/vect/pr66951.c b/gcc/testsuite/gcc.dg/vect/pr66951.c
new file mode 100644 (file)
index 0000000..628e1ee
--- /dev/null
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+
+int a, b[16], c, d;
+
+void
+fn1 ()
+{
+  for (; d; d++)
+    {
+      for (a = 0; a < 2; a++)
+       ;
+      c ^= b[d];
+    }
+}
index bafd1297488888a1f7c84e152133df27268a75d0..efcc4bb03365202b9a2e9bffb0bb4083957c5805 100644 (file)
@@ -1178,7 +1178,6 @@ slpeel_tree_peel_loop_to_edge (struct loop *loop, struct loop *scalar_loop,
                               int bound1, int bound2)
 {
   struct loop *new_loop = NULL, *first_loop, *second_loop;
-  struct loop *inner_loop = NULL;
   edge skip_e;
   tree pre_condition = NULL_TREE;
   basic_block bb_before_second_loop, bb_after_second_loop;
@@ -1199,9 +1198,6 @@ slpeel_tree_peel_loop_to_edge (struct loop *loop, struct loop *scalar_loop,
   if (!slpeel_can_duplicate_loop_p (loop, e))
     return NULL;
 
-  if (loop->inner)
-    inner_loop = loop->inner;
-
   /* We might have a queued need to update virtual SSA form.  As we
      delete the update SSA machinery below after doing a regular
      incremental SSA update during loop copying make sure we don't
@@ -1237,9 +1233,8 @@ slpeel_tree_peel_loop_to_edge (struct loop *loop, struct loop *scalar_loop,
            add_phi_arg (new_phi, vop, exit_e, UNKNOWN_LOCATION);
            gimple_phi_set_result (new_phi, new_vop);
            FOR_EACH_IMM_USE_STMT (stmt, imm_iter, vop)
-             if (stmt != new_phi && gimple_bb (stmt) != loop->header
-                 /* Do not rename PHI arguments in inner-loop.  */
-                 && (!inner_loop || gimple_bb (stmt) != inner_loop->header))
+             if (stmt != new_phi
+                 && !flow_bb_inside_loop_p (loop, gimple_bb (stmt)))
                FOR_EACH_IMM_USE_ON_STMT (use_p, imm_iter)
                  SET_USE (use_p, new_vop);
          }