From 3551257c5d24d5193edbdbc4604c1d995d50902b Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Tue, 30 Apr 2013 15:03:58 +0000 Subject: =?UTF-8?q?re=20PR=20tree-optimization/57122=20(ICE=20in=20verify?= =?UTF-8?q?=5Floop=5Fstructure,=20at=20cfgloop.c:1647=20(loop=20n=E2=80=99?= =?UTF-8?q?s=20latch=20does=20not=20have=20an=20edge=20to=20its=20header?= =?UTF-8?q?=20!))?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2013-04-30 Richard Biener PR middle-end/57122 * cfghooks.c (split_edge): Properly check for the loop latch edge. * gcc.dg/torture/pr57122.c: New testcase. From-SVN: r198456 --- gcc/cfghooks.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gcc/cfghooks.c') diff --git a/gcc/cfghooks.c b/gcc/cfghooks.c index f583b2f..22b962b 100644 --- a/gcc/cfghooks.c +++ b/gcc/cfghooks.c @@ -662,7 +662,9 @@ split_edge (edge e) loop = find_common_loop (src->loop_father, dest->loop_father); add_bb_to_loop (ret, loop); - if (loop->latch == src) + /* If we split the latch edge of loop adjust the latch block. */ + if (loop->latch == src + && loop->header == dest) loop->latch = ret; } -- cgit v1.1