* recog.c (peephole2_optimize): Re-distribute EH edges.

From-SVN: r50452
This commit is contained in:
Jan Hubicka 2002-03-08 21:14:04 +01:00 committed by Jan Hubicka
parent 07fc65c47c
commit 189ae0f4d5
2 changed files with 26 additions and 1 deletions

View File

@ -1,3 +1,7 @@
Fri Mar 8 21:08:52 CET 2002 Jan Hubicka <jh@suse.cz>
* recog.c (peephole2_optimize): Re-distribute EH edges.
2002-03-08 Neil Booth <neil@daikokuya.demon.co.uk> 2002-03-08 Neil Booth <neil@daikokuya.demon.co.uk>
* expr.c (expand_expr): Use unsave lang hook. * expr.c (expand_expr): Use unsave lang hook.

View File

@ -3054,6 +3054,7 @@ peephole2_optimize (dump_file)
{ {
rtx try; rtx try;
int match_len; int match_len;
rtx note;
/* Record this insn. */ /* Record this insn. */
if (--peep2_current < 0) if (--peep2_current < 0)
@ -3105,7 +3106,6 @@ peephole2_optimize (dump_file)
note = XEXP (note, 1)) note = XEXP (note, 1))
switch (REG_NOTE_KIND (note)) switch (REG_NOTE_KIND (note))
{ {
case REG_EH_REGION:
case REG_NORETURN: case REG_NORETURN:
case REG_SETJMP: case REG_SETJMP:
case REG_ALWAYS_RETURN: case REG_ALWAYS_RETURN:
@ -3139,6 +3139,27 @@ peephole2_optimize (dump_file)
try = emit_insn_after (try, peep2_insn_data[i].insn); try = emit_insn_after (try, peep2_insn_data[i].insn);
delete_insn_chain (insn, 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 #ifdef HAVE_conditional_execution
/* With conditional execution, we cannot back up the /* With conditional execution, we cannot back up the
live information so easily, since the conditional live information so easily, since the conditional