tree-vect-loop-manip.c (rename_variables_in_bb): Rename PHI nodes when copying loop...
authorBin Cheng <bin.cheng@arm.com>
Tue, 10 Oct 2017 13:58:30 +0000 (13:58 +0000)
committerBin Cheng <amker@gcc.gnu.org>
Tue, 10 Oct 2017 13:58:30 +0000 (13:58 +0000)
* tree-vect-loop-manip.c (rename_variables_in_bb): Rename PHI nodes
when copying loop nest with only one inner loop.

gcc/testsuite
* gcc.dg/tree-ssa/ldist-34.c: New test.

From-SVN: r253586

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

index f7f41ed3358f29a7cd20dd4ff8055727c6e2fd2b..ed487273fb908db9766b9e7e1b371024cb550372 100644 (file)
@@ -1,3 +1,8 @@
+2017-10-10  Bin Cheng  <bin.cheng@arm.com>
+
+       * tree-vect-loop-manip.c (rename_variables_in_bb): Rename PHI nodes
+       when copying loop nest with only one inner loop.
+
 2017-10-10  Richard Biener  <rguenther@suse.de>
 
        * tree-cfgcleanup.c (cleanup_tree_cfg_noloop): Avoid compacting
index ee9d34c78668fb2ca98233544dcc25cfd4b81905..78a0cc40f9a6b9a2e388a6884d74716f95be336b 100644 (file)
@@ -1,3 +1,7 @@
+2017-10-10  Bin Cheng  <bin.cheng@arm.com>
+
+       * gcc.dg/tree-ssa/ldist-34.c: New test.
+
 2017-10-10  Bin Cheng  <bin.cheng@arm.com>
 
        * gcc.dg/tree-ssa/ldist-27.c: New test.
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ldist-34.c b/gcc/testsuite/gcc.dg/tree-ssa/ldist-34.c
new file mode 100644 (file)
index 0000000..3d68a85
--- /dev/null
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-distribution" } */
+
+#define X (3.0)
+int b, c;
+double a[30000];
+int foo () {
+  for (int i = 0; i < 100; ++i) {
+    for (int j = 0; j < c; ++j)
+      if (b)
+        a[0] = b;
+    a[i * 100] = a[1] = X;
+  }
+  return 0;
+}
index fb73a885b248414fcc6e86237817dc7b11d34a76..d608533714769c28a8e6f5e438c7e37ae3a171a3 100644 (file)
@@ -117,8 +117,6 @@ rename_variables_in_bb (basic_block bb, bool rename_from_outer_loop)
                      || single_pred (e->src) != outer_loop->header)
                    continue;
                }
-             else
-               continue;
            }
        }
       for (gphi_iterator gsi = gsi_start_phis (bb); !gsi_end_p (gsi);