aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-loop-distribution.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2016-07-15 13:05:56 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2016-07-15 13:05:56 +0000
commitb9aba0a05820874b01e67264a02494d5d8d27309 (patch)
tree63f8b69a265fbe07bef4e9bf4304157f191a30df /gcc/tree-loop-distribution.c
parent9513d5fbcabaf84b5e8450e8bb16894b3d42ba96 (diff)
downloadgcc-b9aba0a05820874b01e67264a02494d5d8d27309.zip
gcc-b9aba0a05820874b01e67264a02494d5d8d27309.tar.gz
gcc-b9aba0a05820874b01e67264a02494d5d8d27309.tar.bz2
re PR tree-optimization/71881 (ICE on valid code at -O3 with -g enabled on x86_64-linux-gnu: cannot update SSA form)
2016-07-15 Richard Biener <rguenther@suse.de> PR tree-optimization/71881 * tree-loop-distribution.c (destroy_loop): Remove blocks in reverse DOM order to make debug temp generation happy. * gcc.dg/torture/pr71881.c: New testcase. From-SVN: r238374
Diffstat (limited to 'gcc/tree-loop-distribution.c')
-rw-r--r--gcc/tree-loop-distribution.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c
index 9bca56a..181e4e9 100644
--- a/gcc/tree-loop-distribution.c
+++ b/gcc/tree-loop-distribution.c
@@ -888,13 +888,15 @@ destroy_loop (struct loop *loop)
cancel_loop_tree (loop);
rescan_loop_exit (exit, false, true);
- for (i = 0; i < nbbs; i++)
+ i = nbbs;
+ do
{
/* We have made sure to not leave any dangling uses of SSA
names defined in the loop. With the exception of virtuals.
Make sure we replace all uses of virtual defs that will remain
outside of the loop with the bare symbol as delete_basic_block
will release them. */
+ --i;
for (gphi_iterator gsi = gsi_start_phis (bbs[i]); !gsi_end_p (gsi);
gsi_next (&gsi))
{
@@ -912,6 +914,8 @@ destroy_loop (struct loop *loop)
}
delete_basic_block (bbs[i]);
}
+ while (i != 0);
+
free (bbs);
set_immediate_dominator (CDI_DOMINATORS, dest,