aboutsummaryrefslogtreecommitdiff
path: root/gcc/recog.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2002-05-13 16:00:35 -0700
committerRichard Henderson <rth@gcc.gnu.org>2002-05-13 16:00:35 -0700
commit546c093ec5f84f1659723329061c47070a9956ef (patch)
tree5f32b69c8a701e1b7a8f5a41ad0369d83f86c15c /gcc/recog.c
parentbde5348670f9371fb8eff9ae1b4c91a1903074a6 (diff)
downloadgcc-546c093ec5f84f1659723329061c47070a9956ef.zip
gcc-546c093ec5f84f1659723329061c47070a9956ef.tar.gz
gcc-546c093ec5f84f1659723329061c47070a9956ef.tar.bz2
cfgrtl.c (purge_dead_edges): Handle abnormal call edges created by non-local gotos.
* cfgrtl.c (purge_dead_edges): Handle abnormal call edges created by non-local gotos. * recog.c (peephole2_optimize): Likewise. From-SVN: r53438
Diffstat (limited to 'gcc/recog.c')
-rw-r--r--gcc/recog.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/gcc/recog.c b/gcc/recog.c
index a0075ef..c3dbee2 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -3051,6 +3051,7 @@ peephole2_optimize (dump_file)
rtx try, before_try, x;
int match_len;
rtx note;
+ bool was_call = false;
/* Record this insn. */
if (--peep2_current < 0)
@@ -3077,6 +3078,7 @@ peephole2_optimize (dump_file)
old_insn = peep2_insn_data[j].insn;
if (GET_CODE (old_insn) != CALL_INSN)
continue;
+ was_call = true;
new_insn = NULL_RTX;
if (GET_CODE (try) == SEQUENCE)
@@ -3140,13 +3142,13 @@ peephole2_optimize (dump_file)
delete_insn_chain (insn, peep2_insn_data[i].insn);
/* Re-insert the EH_REGION notes. */
- if (note)
+ if (note || (was_call && nonlocal_goto_handler_labels))
{
edge eh_edge;
for (eh_edge = bb->succ; eh_edge
; eh_edge = eh_edge->succ_next)
- if (eh_edge->flags & EDGE_EH)
+ if (eh_edge->flags & (EDGE_EH | EDGE_ABNORMAL_CALL))
break;
for (x = try ; x != before_try ; x = PREV_INSN (x))
@@ -3155,10 +3157,11 @@ peephole2_optimize (dump_file)
&& may_trap_p (PATTERN (x))
&& !find_reg_note (x, REG_EH_REGION, NULL)))
{
- REG_NOTES (x)
- = gen_rtx_EXPR_LIST (REG_EH_REGION,
- XEXP (note, 0),
- REG_NOTES (x));
+ if (note)
+ REG_NOTES (x)
+ = gen_rtx_EXPR_LIST (REG_EH_REGION,
+ XEXP (note, 0),
+ REG_NOTES (x));
if (x != bb->end && eh_edge)
{
@@ -3166,7 +3169,8 @@ peephole2_optimize (dump_file)
int flags;
nfte = split_block (bb, x);
- flags = EDGE_EH | EDGE_ABNORMAL;
+ flags = (eh_edge->flags
+ & (EDGE_EH | EDGE_ABNORMAL));
if (GET_CODE (x) == CALL_INSN)
flags |= EDGE_ABNORMAL_CALL;
nehe = make_edge (nfte->src, eh_edge->dest,