Commit e5687447 by Jim Wilson

(eliminate_regs): All recursive calls now pass INSN instead of NULL_RTX.

(eliminate_regs): All recursive calls now pass INSN
instead of NULL_RTX.  Second assignment to ref_outside_mem changed
to be same as first assignment.

From-SVN: r5517
parent 1347292b
...@@ -2676,7 +2676,7 @@ eliminate_regs (x, mem_mode, insn) ...@@ -2676,7 +2676,7 @@ eliminate_regs (x, mem_mode, insn)
reference to the pseudo. Ensure we make a copy of the reference to the pseudo. Ensure we make a copy of the
address in case it is shared. */ address in case it is shared. */
new = eliminate_regs (reg_equiv_memory_loc[regno], new = eliminate_regs (reg_equiv_memory_loc[regno],
mem_mode, NULL_RTX); mem_mode, insn);
if (new != reg_equiv_memory_loc[regno]) if (new != reg_equiv_memory_loc[regno])
{ {
cannot_omit_stores[regno] = 1; cannot_omit_stores[regno] = 1;
...@@ -2696,7 +2696,10 @@ eliminate_regs (x, mem_mode, insn) ...@@ -2696,7 +2696,10 @@ eliminate_regs (x, mem_mode, insn)
ep++) ep++)
if (ep->from_rtx == XEXP (x, 0) && ep->can_eliminate) if (ep->from_rtx == XEXP (x, 0) && 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;
/* The only time we want to replace a PLUS with a REG (this /* The only time we want to replace a PLUS with a REG (this
...@@ -2735,8 +2738,8 @@ eliminate_regs (x, mem_mode, insn) ...@@ -2735,8 +2738,8 @@ eliminate_regs (x, mem_mode, insn)
reload. This is the desired action. */ reload. This is the desired action. */
{ {
rtx new0 = eliminate_regs (XEXP (x, 0), mem_mode, NULL_RTX); rtx new0 = eliminate_regs (XEXP (x, 0), mem_mode, insn);
rtx new1 = eliminate_regs (XEXP (x, 1), mem_mode, NULL_RTX); rtx new1 = eliminate_regs (XEXP (x, 1), mem_mode, insn);
if (new0 != XEXP (x, 0) || new1 != XEXP (x, 1)) if (new0 != XEXP (x, 0) || new1 != XEXP (x, 1))
{ {
...@@ -2773,7 +2776,7 @@ eliminate_regs (x, mem_mode, insn) ...@@ -2773,7 +2776,7 @@ eliminate_regs (x, mem_mode, insn)
/* If we have something in XEXP (x, 0), the usual case, eliminate it. */ /* If we have something in XEXP (x, 0), the usual case, eliminate it. */
if (XEXP (x, 0)) if (XEXP (x, 0))
{ {
new = eliminate_regs (XEXP (x, 0), mem_mode, NULL_RTX); new = eliminate_regs (XEXP (x, 0), mem_mode, insn);
if (new != XEXP (x, 0)) if (new != XEXP (x, 0))
x = gen_rtx (EXPR_LIST, REG_NOTE_KIND (x), new, XEXP (x, 1)); x = gen_rtx (EXPR_LIST, REG_NOTE_KIND (x), new, XEXP (x, 1));
} }
...@@ -2786,7 +2789,7 @@ eliminate_regs (x, mem_mode, insn) ...@@ -2786,7 +2789,7 @@ eliminate_regs (x, mem_mode, insn)
strictly needed, but it simplifies the code. */ strictly needed, but it simplifies the code. */
if (XEXP (x, 1)) if (XEXP (x, 1))
{ {
new = eliminate_regs (XEXP (x, 1), mem_mode, NULL_RTX); new = eliminate_regs (XEXP (x, 1), mem_mode, insn);
if (new != XEXP (x, 1)) if (new != XEXP (x, 1))
return gen_rtx (INSN_LIST, GET_MODE (x), XEXP (x, 0), new); return gen_rtx (INSN_LIST, GET_MODE (x), XEXP (x, 0), new);
} }
...@@ -2805,9 +2808,9 @@ eliminate_regs (x, mem_mode, insn) ...@@ -2805,9 +2808,9 @@ eliminate_regs (x, mem_mode, insn)
case GE: case GT: case GEU: case GTU: case GE: case GT: case GEU: case GTU:
case LE: case LT: case LEU: case LTU: case LE: case LT: case LEU: case LTU:
{ {
rtx new0 = eliminate_regs (XEXP (x, 0), mem_mode, NULL_RTX); rtx new0 = eliminate_regs (XEXP (x, 0), mem_mode, insn);
rtx new1 rtx new1
= XEXP (x, 1) ? eliminate_regs (XEXP (x, 1), mem_mode, NULL_RTX) : 0; = XEXP (x, 1) ? eliminate_regs (XEXP (x, 1), mem_mode, insn) : 0;
if (new0 != XEXP (x, 0) || new1 != XEXP (x, 1)) if (new0 != XEXP (x, 0) || new1 != XEXP (x, 1))
return gen_rtx (code, GET_MODE (x), new0, new1); return gen_rtx (code, GET_MODE (x), new0, new1);
...@@ -2845,7 +2848,7 @@ eliminate_regs (x, mem_mode, insn) ...@@ -2845,7 +2848,7 @@ eliminate_regs (x, mem_mode, insn)
case ABS: case ABS:
case SQRT: case SQRT:
case FFS: case FFS:
new = eliminate_regs (XEXP (x, 0), mem_mode, NULL_RTX); new = eliminate_regs (XEXP (x, 0), mem_mode, insn);
if (new != XEXP (x, 0)) if (new != XEXP (x, 0))
return gen_rtx (code, GET_MODE (x), new); return gen_rtx (code, GET_MODE (x), new);
return x; return x;
...@@ -2864,7 +2867,7 @@ eliminate_regs (x, mem_mode, insn) ...@@ -2864,7 +2867,7 @@ eliminate_regs (x, mem_mode, insn)
&& reg_equiv_memory_loc[REGNO (SUBREG_REG (x))] != 0) && reg_equiv_memory_loc[REGNO (SUBREG_REG (x))] != 0)
{ {
new = eliminate_regs (reg_equiv_memory_loc[REGNO (SUBREG_REG (x))], new = eliminate_regs (reg_equiv_memory_loc[REGNO (SUBREG_REG (x))],
mem_mode, NULL_RTX); mem_mode, insn);
/* If we didn't change anything, we must retain the pseudo. */ /* If we didn't change anything, we must retain the pseudo. */
if (new == reg_equiv_memory_loc[REGNO (SUBREG_REG (x))]) if (new == reg_equiv_memory_loc[REGNO (SUBREG_REG (x))])
...@@ -2875,7 +2878,7 @@ eliminate_regs (x, mem_mode, insn) ...@@ -2875,7 +2878,7 @@ eliminate_regs (x, mem_mode, insn)
new = copy_rtx (new); new = copy_rtx (new);
} }
else else
new = eliminate_regs (SUBREG_REG (x), mem_mode, NULL_RTX); new = eliminate_regs (SUBREG_REG (x), mem_mode, insn);
if (new != XEXP (x, 0)) if (new != XEXP (x, 0))
{ {
...@@ -2920,7 +2923,7 @@ eliminate_regs (x, mem_mode, insn) ...@@ -2920,7 +2923,7 @@ eliminate_regs (x, mem_mode, insn)
if (ep->to_rtx == XEXP (x, 0)) if (ep->to_rtx == XEXP (x, 0))
ep->can_eliminate = 0; ep->can_eliminate = 0;
new = eliminate_regs (XEXP (x, 0), mem_mode, NULL_RTX); new = eliminate_regs (XEXP (x, 0), mem_mode, insn);
if (new != XEXP (x, 0)) if (new != XEXP (x, 0))
return gen_rtx (code, GET_MODE (x), new); return gen_rtx (code, GET_MODE (x), new);
return x; return x;
...@@ -2938,7 +2941,7 @@ eliminate_regs (x, mem_mode, insn) ...@@ -2938,7 +2941,7 @@ eliminate_regs (x, mem_mode, insn)
temp_vec = (rtx *) alloca (XVECLEN (x, 3) * sizeof (rtx)); temp_vec = (rtx *) alloca (XVECLEN (x, 3) * sizeof (rtx));
for (i = 0; i < ASM_OPERANDS_INPUT_LENGTH (x); i++) for (i = 0; i < ASM_OPERANDS_INPUT_LENGTH (x); i++)
temp_vec[i] = eliminate_regs (ASM_OPERANDS_INPUT (x, i), temp_vec[i] = eliminate_regs (ASM_OPERANDS_INPUT (x, i),
mem_mode, NULL_RTX); mem_mode, insn);
for (i = 0; i < ASM_OPERANDS_INPUT_LENGTH (x); i++) for (i = 0; i < ASM_OPERANDS_INPUT_LENGTH (x); i++)
if (temp_vec[i] != ASM_OPERANDS_INPUT (x, i)) if (temp_vec[i] != ASM_OPERANDS_INPUT (x, i))
...@@ -3009,8 +3012,8 @@ eliminate_regs (x, mem_mode, insn) ...@@ -3009,8 +3012,8 @@ eliminate_regs (x, mem_mode, insn)
/* Now avoid the loop below in this common case. */ /* Now avoid the loop below in this common case. */
{ {
rtx new0 = eliminate_regs (SET_DEST (x), 0, NULL_RTX); rtx new0 = eliminate_regs (SET_DEST (x), 0, insn);
rtx new1 = eliminate_regs (SET_SRC (x), 0, NULL_RTX); rtx new1 = eliminate_regs (SET_SRC (x), 0, insn);
/* If SET_DEST changed from a REG to a MEM and INSN is an insn, /* If SET_DEST changed from a REG to a MEM and INSN is an insn,
write a CLOBBER insn. */ write a CLOBBER insn. */
...@@ -3029,7 +3032,7 @@ eliminate_regs (x, mem_mode, insn) ...@@ -3029,7 +3032,7 @@ eliminate_regs (x, mem_mode, insn)
/* Our only special processing is to pass the mode of the MEM to our /* Our only special processing is to pass the mode of the MEM to our
recursive call and copy the flags. While we are here, handle this recursive call and copy the flags. While we are here, handle this
case more efficiently. */ case more efficiently. */
new = eliminate_regs (XEXP (x, 0), GET_MODE (x), NULL_RTX); new = eliminate_regs (XEXP (x, 0), GET_MODE (x), insn);
if (new != XEXP (x, 0)) if (new != XEXP (x, 0))
{ {
new = gen_rtx (MEM, GET_MODE (x), new); new = gen_rtx (MEM, GET_MODE (x), new);
...@@ -3049,7 +3052,7 @@ eliminate_regs (x, mem_mode, insn) ...@@ -3049,7 +3052,7 @@ eliminate_regs (x, mem_mode, insn)
{ {
if (*fmt == 'e') if (*fmt == 'e')
{ {
new = eliminate_regs (XEXP (x, i), mem_mode, NULL_RTX); new = eliminate_regs (XEXP (x, i), mem_mode, insn);
if (new != XEXP (x, i) && ! copied) if (new != XEXP (x, i) && ! copied)
{ {
rtx new_x = rtx_alloc (code); rtx new_x = rtx_alloc (code);
......
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