aboutsummaryrefslogtreecommitdiff
path: root/gcc/recog.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2009-09-14 12:18:58 -0700
committerRichard Henderson <rth@gcc.gnu.org>2009-09-14 12:18:58 -0700
commit1d65f45cfaefa060737af130c3fc69afb3030980 (patch)
tree2fcbbb5f99b13293753d83230cf9f4e0893a9b51 /gcc/recog.c
parent0c433c31b31f25e3f18e58bd8d404c02722d7f7c (diff)
downloadgcc-1d65f45cfaefa060737af130c3fc69afb3030980.zip
gcc-1d65f45cfaefa060737af130c3fc69afb3030980.tar.gz
gcc-1d65f45cfaefa060737af130c3fc69afb3030980.tar.bz2
Squash commit of EH in gimple
From-SVN: r151696
Diffstat (limited to 'gcc/recog.c')
-rw-r--r--gcc/recog.c60
1 files changed, 29 insertions, 31 deletions
diff --git a/gcc/recog.c b/gcc/recog.c
index c1e25d7..bfca43b 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. */