summaryrefslogtreecommitdiff
path: root/gcc/recog.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-08 20:14:04 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-08 20:14:04 +0000
commitfbf81687ed26d6697dac7b3ff54d35d4c13747bb (patch)
tree8b96f4c7e6fd1a9c5bce9b9939d59c4b2d420add /gcc/recog.c
parentf15731c43ae5e8cea424ea40f905c19afa1bd2e4 (diff)
downloadgcc-fbf81687ed26d6697dac7b3ff54d35d4c13747bb.tar.gz
* recog.c (peephole2_optimize): Re-distribute EH edges.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@50452 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/recog.c')
-rw-r--r--gcc/recog.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/gcc/recog.c b/gcc/recog.c
index 968f1e51d08..9eb953878af 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -3054,6 +3054,7 @@ peephole2_optimize (dump_file)
{
rtx try;
int match_len;
+ rtx note;
/* Record this insn. */
if (--peep2_current < 0)
@@ -3105,7 +3106,6 @@ peephole2_optimize (dump_file)
note = XEXP (note, 1))
switch (REG_NOTE_KIND (note))
{
- case REG_EH_REGION:
case REG_NORETURN:
case REG_SETJMP:
case REG_ALWAYS_RETURN:
@@ -3139,6 +3139,27 @@ peephole2_optimize (dump_file)
try = emit_insn_after (try, peep2_insn_data[i].insn);
delete_insn_chain (insn, peep2_insn_data[i].insn);
+ /* Re-insert the EH_REGION notes. */
+ if (try == bb->end
+ && (note = find_reg_note (peep2_insn_data[i].insn,
+ REG_EH_REGION, NULL_RTX)))
+ {
+ rtx x;
+ for (x = NEXT_INSN (peep2_insn_data[i].insn);
+ x != NEXT_INSN (try); x = NEXT_INSN (x))
+ if (GET_CODE (x) == CALL_INSN
+ || (flag_non_call_exceptions
+ && may_trap_p (PATTERN (x))))
+ REG_NOTES (x)
+ = gen_rtx_EXPR_LIST (REG_EH_REGION,
+ XEXP (note, 0),
+ REG_NOTES (x));
+ }
+ /* Converting possibly trapping insn to non-trapping is
+ possible. Zap dummy outgoing edges. */
+ if (try == bb->end)
+ purge_dead_edges (bb);
+
#ifdef HAVE_conditional_execution
/* With conditional execution, we cannot back up the
live information so easily, since the conditional