Commit 4eea1672 by Richard Henderson Committed by Richard Henderson

reload1.c (emit_reload_insns): Also find equivalent mems for subregs of pseudos.

        * reload1.c (emit_reload_insns): Also find equivalent mems
        for subregs of pseudos.

From-SVN: r26444
parent c5fb6d4a
Wed Apr 14 09:59:38 1999 Richard Henderson <rth@cygnus.com>
* reload1.c (emit_reload_insns): Also find equivalent mems
for subregs of pseudos.
Wed Apr 14 09:39:20 1999 Richard Henderson <rth@cygnus.com> Wed Apr 14 09:39:20 1999 Richard Henderson <rth@cygnus.com>
* i386.md (neghi): Use the whole register when widening the op. * i386.md (neghi): Use the whole register when widening the op.
......
...@@ -6865,6 +6865,7 @@ emit_reload_insns (chain) ...@@ -6865,6 +6865,7 @@ emit_reload_insns (chain)
int secondary_reload = reload_secondary_in_reload[j]; int secondary_reload = reload_secondary_in_reload[j];
rtx real_oldequiv = oldequiv; rtx real_oldequiv = oldequiv;
rtx real_old = old; rtx real_old = old;
rtx tmp;
/* If OLDEQUIV is a pseudo with a MEM, get the real MEM /* If OLDEQUIV is a pseudo with a MEM, get the real MEM
and similarly for OLD. and similarly for OLD.
...@@ -6873,30 +6874,42 @@ emit_reload_insns (chain) ...@@ -6873,30 +6874,42 @@ emit_reload_insns (chain)
equivalent MEM, we must fall back to reload_in, which equivalent MEM, we must fall back to reload_in, which
will have all the necessary substitutions registered. will have all the necessary substitutions registered.
Likewise for a pseudo that can't be replaced with its Likewise for a pseudo that can't be replaced with its
equivalent constant. */ equivalent constant.
Take extra care for subregs of such pseudos. Note that
we cannot use reg_equiv_mem in this case because it is
not in the right mode. */
if (GET_CODE (oldequiv) == REG tmp = oldequiv;
&& REGNO (oldequiv) >= FIRST_PSEUDO_REGISTER if (GET_CODE (tmp) == SUBREG)
&& (reg_equiv_memory_loc[REGNO (oldequiv)] != 0 tmp = SUBREG_REG (tmp);
|| reg_equiv_constant[REGNO (oldequiv)] != 0)) if (GET_CODE (tmp) == REG
&& REGNO (tmp) >= FIRST_PSEUDO_REGISTER
&& (reg_equiv_memory_loc[REGNO (tmp)] != 0
|| reg_equiv_constant[REGNO (tmp)] != 0))
{ {
if (! reg_equiv_mem[REGNO (oldequiv)] if (! reg_equiv_mem[REGNO (tmp)]
|| num_not_at_initial_offset) || num_not_at_initial_offset
|| GET_CODE (oldequiv) == SUBREG)
real_oldequiv = reload_in[j]; real_oldequiv = reload_in[j];
else else
real_oldequiv = reg_equiv_mem[REGNO (oldequiv)]; real_oldequiv = reg_equiv_mem[REGNO (tmp)];
} }
if (GET_CODE (old) == REG tmp = old;
&& REGNO (old) >= FIRST_PSEUDO_REGISTER if (GET_CODE (tmp) == SUBREG)
&& (reg_equiv_memory_loc[REGNO (old)] != 0 tmp = SUBREG_REG (tmp);
|| reg_equiv_constant[REGNO (old)] != 0)) if (GET_CODE (tmp) == REG
&& REGNO (tmp) >= FIRST_PSEUDO_REGISTER
&& (reg_equiv_memory_loc[REGNO (tmp)] != 0
|| reg_equiv_constant[REGNO (tmp)] != 0))
{ {
if (! reg_equiv_mem[REGNO (old)] if (! reg_equiv_mem[REGNO (tmp)]
|| num_not_at_initial_offset) || num_not_at_initial_offset
|| GET_CODE (old) == SUBREG)
real_old = reload_in[j]; real_old = reload_in[j];
else else
real_old = reg_equiv_mem[REGNO (old)]; real_old = reg_equiv_mem[REGNO (tmp)];
} }
second_reload_reg = reload_reg_rtx[secondary_reload]; second_reload_reg = reload_reg_rtx[secondary_reload];
......
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