aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgloop.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/cfgloop.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/cfgloop.c')
-rw-r--r--gcc/cfgloop.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c
index 3619907..751da5a 100644
--- a/gcc/cfgloop.c
+++ b/gcc/cfgloop.c
@@ -466,6 +466,8 @@ flow_loops_find (struct loops *loops)
"loop %d with header %d\n",
loop->num, header->index);
}
+ /* Reset latch, we recompute it below. */
+ loop->latch = NULL;
larray.safe_push (loop);
}
@@ -1413,6 +1415,19 @@ verify_loop_structure (void)
error ("loop %d%'s header does not have exactly 2 entries", i);
err = 1;
}
+ if (loop->latch)
+ {
+ if (!find_edge (loop->latch, loop->header))
+ {
+ error ("loop %d%'s latch does not have an edge to its header", i);
+ err = 1;
+ }
+ if (!dominated_by_p (CDI_DOMINATORS, loop->latch, loop->header))
+ {
+ error ("loop %d%'s latch is not dominated by its header", i);
+ err = 1;
+ }
+ }
if (loops_state_satisfies_p (LOOPS_HAVE_SIMPLE_LATCHES))
{
if (!single_succ_p (loop->latch))