diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-02-18 13:03:15 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-02-18 13:03:15 +0000 |
commit | b375c775b913eba47902f2f0aed89f4e2e22759c (patch) | |
tree | fa9d3fe97ade8428e04dda97cbfe0aa6c5a1329e /gcc/cfghooks.c | |
parent | e6b37e57d7cd38d9ce2553e47e6c702d0d9f492a (diff) | |
download | gcc-b375c775b913eba47902f2f0aed89f4e2e22759c.tar.gz |
2013-02-18 Richard Biener <rguenther@suse.de>
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196118 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfghooks.c')
-rw-r--r-- | gcc/cfghooks.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/cfghooks.c b/gcc/cfghooks.c index 54f805f5ff9..5e3eeb587b5 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; |