diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-04-30 15:03:58 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-04-30 15:03:58 +0000 |
commit | 65a021765f8f4a98440389b59efe4f1a7876d273 (patch) | |
tree | ecfd28b26879586b3406ed9bd53c63c9752a365e /gcc/cfghooks.c | |
parent | 0ba38440a820190f334d31e30fb9faf2823ed6cc (diff) | |
download | gcc-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.c | 4 |
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; } |