tree-vect-loop-manip.c (slpeel_tree_duplicate_loop_to_edge_cfg): Skip renaming variab...
authorBin Cheng <bin.cheng@arm.com>
Tue, 10 Oct 2017 08:59:23 +0000 (08:59 +0000)
committerBin Cheng <amker@gcc.gnu.org>
Tue, 10 Oct 2017 08:59:23 +0000 (08:59 +0000)
* tree-vect-loop-manip.c (slpeel_tree_duplicate_loop_to_edge_cfg): Skip
renaming variables in new preheader if it's deleted.

From-SVN: r253579

gcc/ChangeLog
gcc/tree-vect-loop-manip.c

index 9b6beb841067ebfb15416e608462ca240e905863..6ce0d73dc4711f622305d7fbcb2d55792a480e96 100644 (file)
@@ -1,3 +1,8 @@
+2017-10-10  Bin Cheng  <bin.cheng@arm.com>
+
+       * tree-vect-loop-manip.c (slpeel_tree_duplicate_loop_to_edge_cfg): Skip
+       renaming variables in new preheader if it's deleted.
+
 2017-10-10  Bin Cheng  <bin.cheng@arm.com>
 
        * tree-loop-distribution.c (struct partition): Remove unused field
index 5787d53a83a4000da30d7415f482a2b5e581ea5a..fb73a885b248414fcc6e86237817dc7b11d34a76 100644 (file)
@@ -496,7 +496,8 @@ slpeel_tree_duplicate_loop_to_edge_cfg (struct loop *loop,
                               loop_preheader_edge (new_loop)->src);
     }
 
-  for (unsigned i = 0; i < scalar_loop->num_nodes + 1; i++)
+  /* Skip new preheader since it's deleted if copy loop is added at entry.  */
+  for (unsigned i = (at_exit ? 0 : 1); i < scalar_loop->num_nodes + 1; i++)
     rename_variables_in_bb (new_bbs[i], duplicate_outer_loop);
 
   if (scalar_loop != loop)