aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfghooks.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2013-04-30 15:03:58 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2013-04-30 15:03:58 +0000
commit3551257c5d24d5193edbdbc4604c1d995d50902b (patch)
treeecfd28b26879586b3406ed9bd53c63c9752a365e /gcc/cfghooks.c
parent4c1aff1ce430fdf4b46caa632fd44b4d0f557720 (diff)
downloadgcc-3551257c5d24d5193edbdbc4604c1d995d50902b.zip
gcc-3551257c5d24d5193edbdbc4604c1d995d50902b.tar.gz
gcc-3551257c5d24d5193edbdbc4604c1d995d50902b.tar.bz2
re PR tree-optimization/57122 (ICE in verify_loop_structure, at cfgloop.c:1647 (loop n’s latch does not have an edge to its header !))
2013-04-30 Richard Biener <rguenther@suse.de> 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
Diffstat (limited to 'gcc/cfghooks.c')
-rw-r--r--gcc/cfghooks.c4
1 files changed, 3 insertions, 1 deletions
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;
}