Commit 1554c2c6 by Richard Kenner

*** empty log message ***

From-SVN: r436
parent a03618e9
......@@ -245,9 +245,9 @@
;; NO_REGS, so we need not have any predicates here.
(define_expand "reload_outsi"
[(set (match_operand:SI 0 "symbolic_memory_operand" "=m")
[(parallel [(set (match_operand:SI 0 "symbolic_memory_operand" "=m")
(match_operand:SI 1 "" "r"))
(match_operand:SI 2 "" "=&b")]
(clobber (match_operand:SI 2 "" "=&b"))])]
""
"")
......
......@@ -4732,6 +4732,22 @@ emit_reload_insns (insn)
if (reload_secondary_reload[j] >= 0)
{
int secondary_reload = reload_secondary_reload[j];
rtx real_oldequiv = oldequiv;
rtx real_old = old;
/* If OLDEQUIV is a pseudo with a MEM, get the real MEM
and similarly for OLD.
See comments in find_secondary_reload in reload.c. */
if (GET_CODE (oldequiv) == REG
&& REGNO (oldequiv) >= FIRST_PSEUDO_REGISTER
&& reg_equiv_mem[REGNO (oldequiv)] != 0)
real_oldequiv = reg_equiv_mem[REGNO (oldequiv)];
if (GET_CODE (old) == REG
&& REGNO (old) >= FIRST_PSEUDO_REGISTER
&& reg_equiv_mem[REGNO (old)] != 0)
real_old = reg_equiv_mem[REGNO (old)];
second_reload_reg = reload_reg_rtx[secondary_reload];
icode = reload_secondary_icode[j];
......@@ -4740,7 +4756,7 @@ emit_reload_insns (insn)
{
enum reg_class new_class
= SECONDARY_INPUT_RELOAD_CLASS (reload_reg_class[j],
mode, oldequiv);
mode, real_oldequiv);
if (new_class == NO_REGS)
second_reload_reg = 0;
......@@ -4751,7 +4767,7 @@ emit_reload_insns (insn)
if (! TEST_HARD_REG_BIT (reg_class_contents[(int) new_class],
REGNO (second_reload_reg)))
oldequiv = old;
oldequiv = old, real_oldequiv = real_old;
else
{
new_icode = reload_in_optab[(int) mode];
......@@ -4761,7 +4777,7 @@ emit_reload_insns (insn)
(reloadreg, mode)))
|| (insn_operand_predicate[(int) new_icode][1]
&& ! ((*insn_operand_predicate[(int) new_icode][1])
(oldequiv, mode)))))
(real_oldequiv, mode)))))
new_icode = CODE_FOR_nothing;
if (new_icode == CODE_FOR_nothing)
......@@ -4773,7 +4789,7 @@ emit_reload_insns (insn)
{
if (!HARD_REGNO_MODE_OK (REGNO (second_reload_reg),
new_mode))
oldequiv = old;
oldequiv = old, real_oldequiv = real_old;
else
second_reload_reg
= gen_reg_rtx (REG, new_mode,
......@@ -4785,14 +4801,18 @@ emit_reload_insns (insn)
/* If we still need a secondary reload register, check
to see if it is being used as a scratch or intermediate
register and generate code appropriately. */
register and generate code appropriately. If we need
a scratch register, use REAL_OLDEQUIV since the form of
the insn may depend on the actual address if it is
a MEM. */
if (second_reload_reg)
{
if (icode != CODE_FOR_nothing)
{
reload_insn = emit_insn_before (GEN_FCN (icode)
(reloadreg, oldequiv,
(reloadreg,
real_oldequiv,
second_reload_reg),
where);
if (this_reload_insn == 0)
......@@ -4814,7 +4834,7 @@ emit_reload_insns (insn)
reload_insn
= emit_insn_before ((GEN_FCN (tertiary_icode)
(second_reload_reg,
oldequiv,
real_oldequiv,
third_reload_reg)),
where);
if (this_reload_insn == 0)
......@@ -5100,9 +5120,16 @@ emit_reload_insns (insn)
one, since it will be stored into OUT. We might need a secondary
register only for an input reload, so check again here. */
if (reload_secondary_reload[j] >= 0
&& (SECONDARY_OUTPUT_RELOAD_CLASS (reload_reg_class[j],
mode, old)
if (reload_secondary_reload[j] >= 0)
{
rtx real_old = old;
if (GET_CODE (old) == REG && REGNO (old) >= FIRST_PSEUDO_REGISTER
&& reg_equiv_mem[REGNO (old)] != 0)
real_old = reg_equiv_mem[REGNO (old)];
if((SECONDARY_OUTPUT_RELOAD_CLASS (reload_reg_class[j],
mode, real_old)
!= NO_REGS))
{
second_reloadreg = reloadreg;
......@@ -5113,7 +5140,8 @@ emit_reload_insns (insn)
if (reload_secondary_icode[j] != CODE_FOR_nothing)
{
emit_insn_before ((GEN_FCN (reload_secondary_icode[j])
(old, second_reloadreg, reloadreg)),
(real_old, second_reloadreg,
reloadreg)),
first_output_reload_insn);
special = 1;
}
......@@ -5142,6 +5170,7 @@ emit_reload_insns (insn)
emit_insn_before (pat, first_output_reload_insn);
}
}
}
#endif
/* Output the last reload insn. */
......
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