From 6aaf596b4072d0864dbe853626f5838bc58922f0 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Mon, 18 Feb 2013 13:03:15 +0000 Subject: re PR tree-optimization/56350 (ICE in vectorizable_reduction, at tree-vect-loop.c:4731) 2013-02-18 Richard Biener 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 --- gcc/cfghooks.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gcc/cfghooks.c') 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; -- cgit v1.1