summaryrefslogtreecommitdiff
path: root/gcc/cfghooks.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2013-04-30 15:03:58 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2013-04-30 15:03:58 +0000
commit65a021765f8f4a98440389b59efe4f1a7876d273 (patch)
treeecfd28b26879586b3406ed9bd53c63c9752a365e /gcc/cfghooks.c
parent0ba38440a820190f334d31e30fb9faf2823ed6cc (diff)
downloadgcc-65a021765f8f4a98440389b59efe4f1a7876d273.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@198456 138bc75d-0d04-0410-961f-82ee72b054a4
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 f583b2fcc39..22b962b52b1 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;
}