diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1996-09-23 16:07:01 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1996-09-23 16:07:01 -0400 |
commit | 59df2b2b6ffe4a193824b8282eeba345495b7117 (patch) | |
tree | 201b99f86621c98d238e435a747f58406946c781 /gcc | |
parent | 0ac224f875278acbee43e8afe1a869ab3318781c (diff) | |
download | gcc-59df2b2b6ffe4a193824b8282eeba345495b7117.zip gcc-59df2b2b6ffe4a193824b8282eeba345495b7117.tar.gz gcc-59df2b2b6ffe4a193824b8282eeba345495b7117.tar.bz2 |
(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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/jump.c | 45 |
1 files changed, 28 insertions, 17 deletions
@@ -449,28 +449,39 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan) sreg, NULL_PTR, dreg, GET_MODE (SET_SRC (body))); -#ifdef PRESERVE_DEATH_INFO_REGNO_P - /* Deleting insn could lose a death-note for SREG or DREG - 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 + if (tem != 0 && + GET_MODE (tem) == GET_MODE (SET_DEST (body))) { /* DREG may have been the target of a REG_DEAD note in the insn which makes INSN redundant. If so, reorg would still think it is dead. So search for such a note and delete it if we find it. */ - for (trial = prev_nonnote_insn (insn); - trial && GET_CODE (trial) != CODE_LABEL; - trial = prev_nonnote_insn (trial)) - if (find_regno_note (trial, REG_DEAD, dreg)) - { - remove_death (dreg, trial); - break; - } - - if (tem != 0 - && GET_MODE (tem) == GET_MODE (SET_DEST (body))) + if (! find_regno_note (insn, REG_UNUSED, dreg)) + for (trial = prev_nonnote_insn (insn); + trial && GET_CODE (trial) != CODE_LABEL; + trial = prev_nonnote_insn (trial)) + if (find_regno_note (trial, REG_DEAD, dreg)) + { + remove_death (dreg, trial); + break; + } +#ifdef PRESERVE_DEATH_INFO_REGNO_P + /* 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); } } |