diff options
author | Richard Guenther <rguenther@suse.de> | 2012-04-17 13:42:48 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2012-04-17 13:42:48 +0000 |
commit | efa26eaae377bf2a5ce9b02b84f3963a0166e280 (patch) | |
tree | a481bf2c7620ac00b781d4d362582751514e3c3f /gcc/tree-eh.c | |
parent | d51e8a2df2f9eadb6aa8a1bcf00d62e17b6ef4cf (diff) | |
download | gcc-efa26eaae377bf2a5ce9b02b84f3963a0166e280.zip gcc-efa26eaae377bf2a5ce9b02b84f3963a0166e280.tar.gz gcc-efa26eaae377bf2a5ce9b02b84f3963a0166e280.tar.bz2 |
re PR rtl-optimization/53011 (ice in verify_loop_structure: bad sizes)
2012-04-17 Richard Guenther <rguenther@suse.de>
PR middle-end/53011
* tree-eh.c (cleanup_empty_eh_merge_phis): Properly discard
loops when redirecting an entry or latch edge.
* g++.dg/torture/pr53011.C: New testcase.
From-SVN: r186529
Diffstat (limited to 'gcc/tree-eh.c')
-rw-r--r-- | gcc/tree-eh.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c index ba188d8..0241a5f 100644 --- a/gcc/tree-eh.c +++ b/gcc/tree-eh.c @@ -3916,6 +3916,21 @@ cleanup_empty_eh_merge_phis (basic_block new_bb, basic_block old_bb, for (ei = ei_start (old_bb->preds); (e = ei_safe_edge (ei)); ) if (e->flags & EDGE_EH) { + /* ??? CFG manipluation routines do not try to update loop + form on edge redirection. Do so manually here for now. */ + /* If we redirect a loop entry or latch edge that will either create + a multiple entry loop or rotate the loop. If the loops merge + we may have created a loop with multiple latches. + All of this isn't easily fixed thus cancel the affected loop + and mark the other loop as possibly having multiple latches. */ + if (current_loops + && e->dest == e->dest->loop_father->header) + { + e->dest->loop_father->header = NULL; + e->dest->loop_father->latch = NULL; + new_bb->loop_father->latch = NULL; + loops_state_set (LOOPS_NEED_FIXUP|LOOPS_MAY_HAVE_MULTIPLE_LATCHES); + } redirect_eh_edge_1 (e, new_bb, change_region); redirect_edge_succ (e, new_bb); flush_pending_stmts (e); |