mirror of git://gcc.gnu.org/git/gcc.git
regrename: Don't rename restores
A restore is supposed to restore some certain register. Restoring it into some other register will not work. Don't. * regrename.c (build_def_use): Invalidate chains that have a REG_CFA_RESTORE on some instruction. From-SVN: r241061
This commit is contained in:
parent
aab648a9fc
commit
d73c92c9f2
|
|
@ -1,3 +1,8 @@
|
||||||
|
2016-10-12 Segher Boessenkool <segher@kernel.crashing.org>
|
||||||
|
|
||||||
|
* regrename.c (build_def_use): Invalidate chains that have a
|
||||||
|
REG_CFA_RESTORE on some instruction.
|
||||||
|
|
||||||
2016-10-12 Segher Boessenkool <segher@kernel.crashing.org>
|
2016-10-12 Segher Boessenkool <segher@kernel.crashing.org>
|
||||||
|
|
||||||
* dce.c (delete_unmarked_insns): Don't delete instructions with
|
* dce.c (delete_unmarked_insns): Don't delete instructions with
|
||||||
|
|
|
||||||
|
|
@ -1655,6 +1655,7 @@ build_def_use (basic_block bb)
|
||||||
(6) For any non-earlyclobber write we find in an operand, make
|
(6) For any non-earlyclobber write we find in an operand, make
|
||||||
a new chain or mark the hard register as live.
|
a new chain or mark the hard register as live.
|
||||||
(7) For any REG_UNUSED, close any chains we just opened.
|
(7) For any REG_UNUSED, close any chains we just opened.
|
||||||
|
(8) For any REG_CFA_RESTORE, kill any chain containing it.
|
||||||
|
|
||||||
We cannot deal with situations where we track a reg in one mode
|
We cannot deal with situations where we track a reg in one mode
|
||||||
and see a reference in another mode; these will cause the chain
|
and see a reference in another mode; these will cause the chain
|
||||||
|
|
@ -1867,6 +1868,12 @@ build_def_use (basic_block bb)
|
||||||
scan_rtx (insn, &XEXP (note, 0), NO_REGS, terminate_dead,
|
scan_rtx (insn, &XEXP (note, 0), NO_REGS, terminate_dead,
|
||||||
OP_IN);
|
OP_IN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Step 8: Kill the chains involving register restores. Those
|
||||||
|
should restore _that_ register. */
|
||||||
|
for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
|
||||||
|
if (REG_NOTE_KIND (note) == REG_CFA_RESTORE)
|
||||||
|
scan_rtx (insn, &XEXP (note, 0), NO_REGS, mark_all_read, OP_IN);
|
||||||
}
|
}
|
||||||
else if (DEBUG_INSN_P (insn)
|
else if (DEBUG_INSN_P (insn)
|
||||||
&& !VAR_LOC_UNKNOWN_P (INSN_VAR_LOCATION_LOC (insn)))
|
&& !VAR_LOC_UNKNOWN_P (INSN_VAR_LOCATION_LOC (insn)))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue