diff options
author | amylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-13 12:25:28 +0000 |
---|---|---|
committer | amylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-13 12:25:28 +0000 |
commit | 520cfd2a23873916fa1a62744727ac634b65ad15 (patch) | |
tree | d0c2231c504647c3430df625b25f132830d3501f /gcc/flow.c | |
parent | 0eed6e19b4a4dc285858c86136ee66cfab6e1a31 (diff) | |
download | gcc-520cfd2a23873916fa1a62744727ac634b65ad15.tar.gz |
PR rtl-optimization/20756:
* basic-block.h (PROP_DEAD_INSN): Define.
* flow.c (propagate_one_insn): Set during mark_set_regs call
for a dead insn.
(mark_set_1): Emit a clobber when we are about to delete a dead insn
that kills a live register.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99655 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/flow.c')
-rw-r--r-- | gcc/flow.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/flow.c b/gcc/flow.c index ff1d861dbe5..9eae74b4ad0 100644 --- a/gcc/flow.c +++ b/gcc/flow.c @@ -1692,8 +1692,12 @@ propagate_one_insn (struct propagate_block_info *pbi, rtx insn) fatal_insn ("Attempt to delete prologue/epilogue insn:", insn); /* Record sets. Do this even for dead instructions, since they - would have killed the values if they hadn't been deleted. */ + would have killed the values if they hadn't been deleted. To + be consistent, we also have to emit a clobber when we delete + an insn that clobbers a live register. */ + pbi->flags |= PROP_DEAD_INSN; mark_set_regs (pbi, PATTERN (insn), insn); + pbi->flags &= ~PROP_DEAD_INSN; /* CC0 is now known to be dead. Either this insn used it, in which case it doesn't anymore, or clobbered it, @@ -2960,6 +2964,8 @@ mark_set_1 (struct propagate_block_info *pbi, enum rtx_code code, rtx reg, rtx c } CLEAR_REGNO_REG_SET (pbi->reg_live, i); } + if (flags & PROP_DEAD_INSN) + emit_insn_after (gen_rtx_CLOBBER (VOIDmode, reg), insn); } } else if (REG_P (reg)) |