aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfghooks.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2013-02-18 13:03:15 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2013-02-18 13:03:15 +0000
commit6aaf596b4072d0864dbe853626f5838bc58922f0 (patch)
treefa9d3fe97ade8428e04dda97cbfe0aa6c5a1329e /gcc/cfghooks.c
parent5e97dfb679abcb5abf5381050d8f754b3289bce6 (diff)
downloadgcc-6aaf596b4072d0864dbe853626f5838bc58922f0.zip
gcc-6aaf596b4072d0864dbe853626f5838bc58922f0.tar.gz
gcc-6aaf596b4072d0864dbe853626f5838bc58922f0.tar.bz2
re PR tree-optimization/56350 (ICE in vectorizable_reduction, at tree-vect-loop.c:4731)
2013-02-18 Richard Biener <rguenther@suse.de> PR middle-end/56350 * cfghooks.c (merge_blocks): If we merge a latch into another block adjust references to it. * cfgloop.c (flow_loops_find): Reset latch before recomputing it. (verify_loop_structure): Verify that a recorded latch is in fact a latch. * gcc.dg/torture/pr56350.c: New testcase. From-SVN: r196118
Diffstat (limited to 'gcc/cfghooks.c')
-rw-r--r--gcc/cfghooks.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/cfghooks.c b/gcc/cfghooks.c
index 54f805f..5e3eeb5 100644
--- a/gcc/cfghooks.c
+++ b/gcc/cfghooks.c
@@ -761,7 +761,12 @@ merge_blocks (basic_block a, basic_block b)
{
e->src = a;
if (current_loops != NULL)
- rescan_loop_exit (e, true, false);
+ {
+ /* If b was a latch, a now is. */
+ if (e->dest->loop_father->latch == b)
+ e->dest->loop_father->latch = a;
+ rescan_loop_exit (e, true, false);
+ }
}
a->succs = b->succs;
a->flags |= b->flags;