Commit ff32812a by Richard Stallman

(eliminate_regs): Specially handle the case where INSN is a note (an EXPR_LIST or INSN_LIST).

(eliminate_regs): Specially handle the case where INSN
is a note (an EXPR_LIST or INSN_LIST).
(eliminate_regs_in_insn): Pass the notes as INSN,
when calling eliminate_insn to process the notes.

From-SVN: r5445
parent 7323e99b
...@@ -2593,11 +2593,16 @@ static struct rtvec_def *old_asm_operands_vec, *new_asm_operands_vec; ...@@ -2593,11 +2593,16 @@ static struct rtvec_def *old_asm_operands_vec, *new_asm_operands_vec;
with the register, which we cannot do outside a MEM. In addition, we need with the register, which we cannot do outside a MEM. In addition, we need
to record the fact that a register is referenced outside a MEM. to record the fact that a register is referenced outside a MEM.
If INSN is nonzero, it is the insn containing X. If we replace a REG If INSN is an insn, it is the insn containing X. If we replace a REG
in a SET_DEST with an equivalent MEM and INSN is non-zero, write a in a SET_DEST with an equivalent MEM and INSN is non-zero, write a
CLOBBER of the pseudo after INSN so find_equiv_regs will know that CLOBBER of the pseudo after INSN so find_equiv_regs will know that
that the REG is being modified. that the REG is being modified.
Alternatively, INSN may be a note (an EXPR_LIST or INSN_LIST).
That's used when we eliminate in expressions stored in notes.
This means, do not set ref_outside_mem even if the reference
is outside of MEMs.
If we see a modification to a register we know about, take the If we see a modification to a register we know about, take the
appropriate action (see case SET, below). appropriate action (see case SET, below).
...@@ -2647,7 +2652,10 @@ eliminate_regs (x, mem_mode, insn) ...@@ -2647,7 +2652,10 @@ eliminate_regs (x, mem_mode, insn)
ep++) ep++)
if (ep->from_rtx == x && ep->can_eliminate) if (ep->from_rtx == x && ep->can_eliminate)
{ {
if (! mem_mode) if (! mem_mode
/* Refs inside notes don't count for this purpose. */
&& ! (insn == 0 && (GET_CODE (insn) == EXPR_LIST
|| GET_CODE (insn) == INSN_LIST)))
ep->ref_outside_mem = 1; ep->ref_outside_mem = 1;
return plus_constant (ep->to_rtx, ep->previous_offset); return plus_constant (ep->to_rtx, ep->previous_offset);
} }
...@@ -3000,10 +3008,10 @@ eliminate_regs (x, mem_mode, insn) ...@@ -3000,10 +3008,10 @@ eliminate_regs (x, mem_mode, insn)
rtx new0 = eliminate_regs (SET_DEST (x), 0, NULL_RTX); rtx new0 = eliminate_regs (SET_DEST (x), 0, NULL_RTX);
rtx new1 = eliminate_regs (SET_SRC (x), 0, NULL_RTX); rtx new1 = eliminate_regs (SET_SRC (x), 0, NULL_RTX);
/* If SET_DEST changed from a REG to a MEM and INSN is non-zero, /* If SET_DEST changed from a REG to a MEM and INSN is an insn,
write a CLOBBER insn. */ write a CLOBBER insn. */
if (GET_CODE (SET_DEST (x)) == REG && GET_CODE (new0) == MEM if (GET_CODE (SET_DEST (x)) == REG && GET_CODE (new0) == MEM
&& insn != 0) && insn != 0 && GET_CODE (insn) != EXPR_LIST)
emit_insn_after (gen_rtx (CLOBBER, VOIDmode, SET_DEST (x)), insn); emit_insn_after (gen_rtx (CLOBBER, VOIDmode, SET_DEST (x)), insn);
if (new0 != SET_DEST (x) || new1 != SET_SRC (x)) if (new0 != SET_DEST (x) || new1 != SET_SRC (x))
...@@ -3243,7 +3251,7 @@ eliminate_regs_in_insn (insn, replace) ...@@ -3243,7 +3251,7 @@ eliminate_regs_in_insn (insn, replace)
of spill registers to be needed in the final reload pass than in of spill registers to be needed in the final reload pass than in
the pre-passes. */ the pre-passes. */
if (val && REG_NOTES (insn) != 0) if (val && REG_NOTES (insn) != 0)
REG_NOTES (insn) = eliminate_regs (REG_NOTES (insn), 0, NULL_RTX); REG_NOTES (insn) = eliminate_regs (REG_NOTES (insn), 0, REG_NOTES (insn));
if (! replace) if (! replace)
pop_obstacks (); pop_obstacks ();
......
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