summaryrefslogtreecommitdiff
path: root/gcc/cfghooks.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2014-03-14 12:54:25 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2014-03-14 12:54:25 +0000
commit671fe6509b7cf0b182a018b77f91ae494b2e32c1 (patch)
tree2e1efaa6b3462efc84836a6f0f0cf7d8df0b5654 /gcc/cfghooks.c
parent0f3c9fa8d4f77947e0b699195dc067d7a832b119 (diff)
downloadgcc-671fe6509b7cf0b182a018b77f91ae494b2e32c1.tar.gz
2014-03-14 Richard Biener <rguenther@suse.de>
PR middle-end/60518 * cfghooks.c (split_block): Properly adjust all loops the block was a latch of. * g++.dg/pr60518.C: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208567 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfghooks.c')
-rw-r--r--gcc/cfghooks.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/cfghooks.c b/gcc/cfghooks.c
index 7cf3cd50a66..bc1634aac87 100644
--- a/gcc/cfghooks.c
+++ b/gcc/cfghooks.c
@@ -510,9 +510,13 @@ split_block (basic_block bb, void *i)
if (current_loops != NULL)
{
+ edge_iterator ei;
+ edge e;
add_bb_to_loop (new_bb, bb->loop_father);
- if (bb->loop_father->latch == bb)
- bb->loop_father->latch = new_bb;
+ /* Identify all loops bb may have been the latch of and adjust them. */
+ FOR_EACH_EDGE (e, ei, new_bb->succs)
+ if (e->dest->loop_father->latch == bb)
+ e->dest->loop_father->latch = new_bb;
}
res = make_single_succ_edge (bb, new_bb, EDGE_FALLTHRU);