diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-03-30 13:40:17 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-03-30 13:40:17 +0000 |
commit | 99cc6bba8cd054726e799834d5c337ed8644c476 (patch) | |
tree | e9003b61195eb2ee90f2007af7528d63e137c32f /gcc/except.c | |
parent | 3cab32518823b920501dadb12384bbac9ed4e83c (diff) | |
download | gcc-99cc6bba8cd054726e799834d5c337ed8644c476.tar.gz |
2012-03-30 Richard Guenther <rguenther@suse.de>
PR middle-end/52772
* except.c (emit_to_new_bb_before): Move loop updating ...
(dw2_build_landing_pads): ... here. Use a proper block for
querying the loop father.
* g++.dg/torture/pr52772.C: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186011 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/except.c')
-rw-r--r-- | gcc/except.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/gcc/except.c b/gcc/except.c index ddc865217bd..e3a9ef07422 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -918,12 +918,6 @@ emit_to_new_bb_before (rtx seq, rtx insn) bb = create_basic_block (seq, last, prev_bb); update_bb_for_insn (bb); bb->flags |= BB_SUPERBLOCK; - if (current_loops) - { - add_bb_to_loop (bb, prev_bb->loop_father); - if (prev_bb->loop_father->header == prev_bb) - prev_bb->loop_father->header = bb; - } return bb; } @@ -995,6 +989,16 @@ dw2_build_landing_pads (void) e = make_edge (bb, bb->next_bb, e_flags); e->count = bb->count; e->probability = REG_BR_PROB_BASE; + if (current_loops) + { + struct loop *loop = bb->next_bb->loop_father; + /* If we created a pre-header block, add the new block to the + outer loop, otherwise to the loop itself. */ + if (bb->next_bb == loop->header) + add_bb_to_loop (bb, loop_outer (loop)); + else + add_bb_to_loop (bb, loop); + } } } |