summaryrefslogtreecommitdiff
path: root/gcc/bb-reorder.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-01 19:46:21 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-01 19:46:21 +0000
commitba59d45742777188d84787fc3e36a424c8b32c66 (patch)
tree9e0a17e9a383ec52b3b585ae4ee302d6b1d3b78e /gcc/bb-reorder.c
parent8e2cc24f01e1f791accad81682738355bcd1a088 (diff)
downloadgcc-ba59d45742777188d84787fc3e36a424c8b32c66.tar.gz
PR middle-end/45458
* bb-reorder.c (add_labels_and_missing_jumps): Treat bbs ending with throwing insns like blocks ending with a call. (fix_up_fall_thru_edges): Likewise. * g++.dg/tree-prof/partition2.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163743 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/bb-reorder.c')
-rw-r--r--gcc/bb-reorder.c38
1 files changed, 21 insertions, 17 deletions
diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
index 2bf0b853165..e4996144761 100644
--- a/gcc/bb-reorder.c
+++ b/gcc/bb-reorder.c
@@ -1299,7 +1299,9 @@ add_labels_and_missing_jumps (edge *crossing_edges, int n_crossing_edges)
if (src && (src != ENTRY_BLOCK_PTR))
{
- if (!JUMP_P (BB_END (src)) && !block_ends_with_call_p (src))
+ if (!JUMP_P (BB_END (src))
+ && !block_ends_with_call_p (src)
+ && !can_throw_internal (BB_END (src)))
/* bb just falls through. */
{
/* make sure there's only one successor */
@@ -1316,9 +1318,9 @@ add_labels_and_missing_jumps (edge *crossing_edges, int n_crossing_edges)
src->il.rtl->footer = unlink_insn_chain (barrier, barrier);
/* Mark edge as non-fallthru. */
crossing_edges[i]->flags &= ~EDGE_FALLTHRU;
- } /* end: 'if (GET_CODE ... ' */
- } /* end: 'if (src && src->index...' */
- } /* end: 'if (dest && dest->index...' */
+ } /* end: 'if (!JUMP_P ... ' */
+ } /* end: 'if (src && src !=...' */
+ } /* end: 'if (dest && dest !=...' */
} /* end: 'if (crossing_edges[i]...' */
} /* end for loop */
}
@@ -1375,19 +1377,21 @@ fix_up_fall_thru_edges (void)
fall_thru = succ2;
cond_jump = succ1;
}
- else if (!fall_thru && succ1 && block_ends_with_call_p (cur_bb))
- {
- edge e;
- edge_iterator ei;
-
- /* Find EDGE_CAN_FALLTHRU edge. */
- FOR_EACH_EDGE (e, ei, cur_bb->succs)
- if (e->flags & EDGE_CAN_FALLTHRU)
- {
- fall_thru = e;
- break;
- }
- }
+ else if (succ1
+ && (block_ends_with_call_p (cur_bb)
+ || can_throw_internal (BB_END (cur_bb))))
+ {
+ edge e;
+ edge_iterator ei;
+
+ /* Find EDGE_CAN_FALLTHRU edge. */
+ FOR_EACH_EDGE (e, ei, cur_bb->succs)
+ if (e->flags & EDGE_CAN_FALLTHRU)
+ {
+ fall_thru = e;
+ break;
+ }
+ }
if (fall_thru && (fall_thru->dest != EXIT_BLOCK_PTR))
{