diff options
author | Richard Biener <rguenth@gcc.gnu.org> | 2014-03-14 12:54:25 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2014-03-14 12:54:25 +0000 |
commit | 1f3388fec4997d12507ebe66f0b0487991f9895e (patch) | |
tree | 2e1efaa6b3462efc84836a6f0f0cf7d8df0b5654 /gcc/cfghooks.c | |
parent | 3d354792e623c04384497eb5f9c06e0c87f49a19 (diff) | |
download | gcc-1f3388fec4997d12507ebe66f0b0487991f9895e.zip gcc-1f3388fec4997d12507ebe66f0b0487991f9895e.tar.gz gcc-1f3388fec4997d12507ebe66f0b0487991f9895e.tar.bz2 |
re PR ipa/60518 (ICE: in verify_loop_structure, at cfgloop.c:1647)
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.
From-SVN: r208567
Diffstat (limited to 'gcc/cfghooks.c')
-rw-r--r-- | gcc/cfghooks.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/cfghooks.c b/gcc/cfghooks.c index 7cf3cd5..bc1634a 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); |