summaryrefslogtreecommitdiff
path: root/gcc/regrename.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2013-01-18 07:54:47 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2013-01-18 07:54:47 +0000
commit1bcf869e98785b311cd21e579677207a5f22abc1 (patch)
treeeeafc6e254984b4679789b0594673c47e2dc2585 /gcc/regrename.c
parenteaac79393946885d2ebbab2ac82956508782887e (diff)
downloadgcc-1bcf869e98785b311cd21e579677207a5f22abc1.tar.gz
PR rtl-optimization/52573
* regrename.c (build_def_use): Ignore REG_DEAD notes if there is a REG_UNUSED for the same register. * gcc.dg/pr52573.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@195288 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/regrename.c')
-rw-r--r--gcc/regrename.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/regrename.c b/gcc/regrename.c
index df3d341db51..20e2ae9f792 100644
--- a/gcc/regrename.c
+++ b/gcc/regrename.c
@@ -1710,9 +1710,16 @@ build_def_use (basic_block bb)
scan_rtx (insn, &XEXP (note, 0), ALL_REGS, mark_read,
OP_INOUT);
- /* Step 4: Close chains for registers that die here. */
+ /* Step 4: Close chains for registers that die here, unless
+ the register is mentioned in a REG_UNUSED note. In that
+ case we keep the chain open until step #7 below to ensure
+ it conflicts with other output operands of this insn.
+ See PR 52573. Arguably the insn should not have both
+ notes; it has proven difficult to fix that without
+ other undesirable side effects. */
for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
- if (REG_NOTE_KIND (note) == REG_DEAD)
+ if (REG_NOTE_KIND (note) == REG_DEAD
+ && !find_regno_note (insn, REG_UNUSED, REGNO (XEXP (note, 0))))
{
remove_from_hard_reg_set (&live_hard_regs,
GET_MODE (XEXP (note, 0)),