diff options
author | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1996-09-23 20:07:01 +0000 |
---|---|---|
committer | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1996-09-23 20:07:01 +0000 |
commit | 14c330dc1647c78d875519c22071aeed0aa788e5 (patch) | |
tree | 201b99f86621c98d238e435a747f58406946c781 /gcc/jump.c | |
parent | 409246b4a4aadac8a9d5582f2f2e2291281c912d (diff) | |
download | gcc-14c330dc1647c78d875519c22071aeed0aa788e5.tar.gz |
(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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@12783 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/jump.c')
-rw-r--r-- | gcc/jump.c | 45 |
1 files changed, 28 insertions, 17 deletions
diff --git a/gcc/jump.c b/gcc/jump.c index 3ce95201c02..6e0e30b14ff 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -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); } } |