diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-09-14 19:18:58 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-09-14 19:18:58 +0000 |
commit | e38def9ca7953bb5611d08ce8617249516ba5a99 (patch) | |
tree | 2fcbbb5f99b13293753d83230cf9f4e0893a9b51 /gcc/recog.c | |
parent | 74facf6eece2aa84e36088e8e9adf175920b2e8a (diff) | |
download | gcc-e38def9ca7953bb5611d08ce8617249516ba5a99.tar.gz |
Squash commit of EH in gimple
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151696 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/recog.c')
-rw-r--r-- | gcc/recog.c | 60 |
1 files changed, 29 insertions, 31 deletions
diff --git a/gcc/recog.c b/gcc/recog.c index c1e25d746a1..bfca43b4552 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -3234,37 +3234,35 @@ peephole2_optimize (void) if (eh_edge->flags & (EDGE_EH | EDGE_ABNORMAL_CALL)) break; - for (x = attempt ; x != before_try ; x = PREV_INSN (x)) - if (CALL_P (x) - || (flag_non_call_exceptions - && may_trap_p (PATTERN (x)) - && !find_reg_note (x, REG_EH_REGION, NULL))) - { - if (note) - add_reg_note (x, REG_EH_REGION, XEXP (note, 0)); - - if (x != BB_END (bb) && eh_edge) - { - edge nfte, nehe; - int flags; - - nfte = split_block (bb, x); - flags = (eh_edge->flags - & (EDGE_EH | EDGE_ABNORMAL)); - if (CALL_P (x)) - flags |= EDGE_ABNORMAL_CALL; - nehe = make_edge (nfte->src, eh_edge->dest, - flags); - - nehe->probability = eh_edge->probability; - nfte->probability - = REG_BR_PROB_BASE - nehe->probability; - - do_cleanup_cfg |= purge_dead_edges (nfte->dest); - bb = nfte->src; - eh_edge = nehe; - } - } + if (note) + copy_reg_eh_region_note_backward (note, attempt, + before_try); + + if (eh_edge) + for (x = attempt ; x != before_try ; x = PREV_INSN (x)) + if (x != BB_END (bb) + && (can_throw_internal (x) + || can_nonlocal_goto (x))) + { + edge nfte, nehe; + int flags; + + nfte = split_block (bb, x); + flags = (eh_edge->flags + & (EDGE_EH | EDGE_ABNORMAL)); + if (CALL_P (x)) + flags |= EDGE_ABNORMAL_CALL; + nehe = make_edge (nfte->src, eh_edge->dest, + flags); + + nehe->probability = eh_edge->probability; + nfte->probability + = REG_BR_PROB_BASE - nehe->probability; + + do_cleanup_cfg |= purge_dead_edges (nfte->dest); + bb = nfte->src; + eh_edge = nehe; + } /* Converting possibly trapping insn to non-trapping is possible. Zap dummy outgoing edges. */ |