Commit 38d8473f by Richard Kenner

(distribute_notes): If can't find place for REG_DEAD note, add an INSN

with a USE to hold it.

From-SVN: r8625
parent 61314cb4
...@@ -10515,9 +10515,10 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1) ...@@ -10515,9 +10515,10 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1)
reg_n_refs[REGNO (XEXP (note, 0))] = 3; reg_n_refs[REGNO (XEXP (note, 0))] = 3;
if (place == 0) if (place == 0)
{
for (tem = prev_nonnote_insn (i3); for (tem = prev_nonnote_insn (i3);
tem && (GET_CODE (tem) == INSN place == 0 && tem
|| GET_CODE (tem) == CALL_INSN); && (GET_CODE (tem) == INSN || GET_CODE (tem) == CALL_INSN);
tem = prev_nonnote_insn (tem)) tem = prev_nonnote_insn (tem))
{ {
/* If the register is being set at TEM, see if that is all /* If the register is being set at TEM, see if that is all
...@@ -10569,6 +10570,17 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1) ...@@ -10569,6 +10570,17 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1)
} }
} }
/* If we haven't found an insn for the death note and it
is still a REG_DEAD note, but we have hit a CODE_LABEL,
insert a USE insn for the register at that label and
put the death node there. This prevents problems with
call-state tracking in caller-save.c. */
if (REG_NOTE_KIND (note) == REG_DEAD && place == 0 && tem != 0)
place
= emit_insn_after (gen_rtx (USE, VOIDmode, XEXP (note, 0)),
tem);
}
/* If the register is set or already dead at PLACE, we needn't do /* If the register is set or already dead at PLACE, we needn't do
anything with this note if it is still a REG_DEAD note. anything with this note if it is still a REG_DEAD note.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment