Commit 59df2b2b by Richard Kenner

(jump_optimize): In no-nop move deletion, don't test PRESERVE_DEATH_INFO_REGNO_P...

(jump_optimize): In no-nop move deletion, don't test
PRESERVE_DEATH_INFO_REGNO_P; instead test if optimization is performed.
Check for REG_UNUSED note on to-be deleted insn before searching for preceding
instruction to delete note from.
If PRESERVE_DEATH_INFO_REGNO_P is true for SREG, replace INSN with USE.

From-SVN: r12783
parent 0ac224f8
...@@ -449,28 +449,39 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan) ...@@ -449,28 +449,39 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
sreg, NULL_PTR, dreg, sreg, NULL_PTR, dreg,
GET_MODE (SET_SRC (body))); GET_MODE (SET_SRC (body)));
#ifdef PRESERVE_DEATH_INFO_REGNO_P if (tem != 0 &&
/* Deleting insn could lose a death-note for SREG or DREG GET_MODE (tem) == GET_MODE (SET_DEST (body)))
so don't do it if final needs accurate death-notes. */
if (! PRESERVE_DEATH_INFO_REGNO_P (sreg)
&& ! PRESERVE_DEATH_INFO_REGNO_P (dreg))
#endif
{ {
/* DREG may have been the target of a REG_DEAD note in /* DREG may have been the target of a REG_DEAD note in
the insn which makes INSN redundant. If so, reorg the insn which makes INSN redundant. If so, reorg
would still think it is dead. So search for such a would still think it is dead. So search for such a
note and delete it if we find it. */ note and delete it if we find it. */
for (trial = prev_nonnote_insn (insn); if (! find_regno_note (insn, REG_UNUSED, dreg))
trial && GET_CODE (trial) != CODE_LABEL; for (trial = prev_nonnote_insn (insn);
trial = prev_nonnote_insn (trial)) trial && GET_CODE (trial) != CODE_LABEL;
if (find_regno_note (trial, REG_DEAD, dreg)) trial = prev_nonnote_insn (trial))
{ if (find_regno_note (trial, REG_DEAD, dreg))
remove_death (dreg, trial); {
break; remove_death (dreg, trial);
} break;
}
if (tem != 0 #ifdef PRESERVE_DEATH_INFO_REGNO_P
&& GET_MODE (tem) == GET_MODE (SET_DEST (body))) /* Deleting insn could lose a death-note for SREG
so don't do it if final needs accurate
death-notes. */
if (PRESERVE_DEATH_INFO_REGNO_P (sreg)
&& (trial = find_regno_note (insn, REG_DEAD, sreg)))
{
/* Change this into a USE so that we won't emit
code for it, but still can keep the note. */
PATTERN (insn)
= gen_rtx (USE, VOIDmode, XEXP (trial, 0));
/* Remove all reg notes but the REG_DEAD one. */
REG_NOTES (insn) = trial;
XEXP (trial, 1) = NULL_RTX;
}
else
#endif
delete_insn (insn); delete_insn (insn);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment