reload1.c (gen_reload:SECONDARY_MEMORY_NEEDED): Handle SUBREG.
2002-10-01 David S. Miller <davem@redhat.com> Jan Hubicka <jh@suse.cz> * reload1.c (gen_reload:SECONDARY_MEMORY_NEEDED): Handle SUBREG. * reload.c (push_reload:SECONDARY_MEMORY_NEEDED): Likewise. Co-Authored-By: Jan Hubicka <jh@suse.cz> From-SVN: r57721
This commit is contained in:
parent
e2e4a99337
commit
5765b16f48
|
@ -1,3 +1,9 @@
|
|||
2002-10-01 David S. Miller <davem@redhat.com>
|
||||
Jan Hubicka <jh@suse.cz>
|
||||
|
||||
* reload1.c (gen_reload:SECONDARY_MEMORY_NEEDED): Handle SUBREG.
|
||||
* reload.c (push_reload:SECONDARY_MEMORY_NEEDED): Likewise.
|
||||
|
||||
2002-09-30 Bob Wilson <bob.wilson@acm.org>
|
||||
|
||||
* config/xtensa/xtensa.h (REG_CLASS_NAMES, REG_CLASS_CONTENTS):
|
||||
|
|
32
gcc/reload.c
32
gcc/reload.c
|
@ -1283,12 +1283,17 @@ push_reload (in, out, inloc, outloc, class,
|
|||
So add an additional reload. */
|
||||
|
||||
#ifdef SECONDARY_MEMORY_NEEDED
|
||||
/* If a memory location is needed for the copy, make one. */
|
||||
if (in != 0 && GET_CODE (in) == REG
|
||||
&& REGNO (in) < FIRST_PSEUDO_REGISTER
|
||||
&& SECONDARY_MEMORY_NEEDED (REGNO_REG_CLASS (REGNO (in)),
|
||||
class, inmode))
|
||||
get_secondary_mem (in, inmode, opnum, type);
|
||||
{
|
||||
int regnum;
|
||||
|
||||
/* If a memory location is needed for the copy, make one. */
|
||||
if (in != 0
|
||||
&& ((regnum = true_regnum (in)) >= 0)
|
||||
&& regnum < FIRST_PSEUDO_REGISTER
|
||||
&& SECONDARY_MEMORY_NEEDED (REGNO_REG_CLASS (regnum),
|
||||
class, inmode))
|
||||
get_secondary_mem (in, inmode, opnum, type);
|
||||
}
|
||||
#endif
|
||||
|
||||
i = n_reloads;
|
||||
|
@ -1314,11 +1319,16 @@ push_reload (in, out, inloc, outloc, class,
|
|||
n_reloads++;
|
||||
|
||||
#ifdef SECONDARY_MEMORY_NEEDED
|
||||
if (out != 0 && GET_CODE (out) == REG
|
||||
&& REGNO (out) < FIRST_PSEUDO_REGISTER
|
||||
&& SECONDARY_MEMORY_NEEDED (class, REGNO_REG_CLASS (REGNO (out)),
|
||||
outmode))
|
||||
get_secondary_mem (out, outmode, opnum, type);
|
||||
{
|
||||
int regnum;
|
||||
|
||||
if (out != 0
|
||||
&& ((regnum = true_regnum (out)) >= 0)
|
||||
&& regnum < FIRST_PSEUDO_REGISTER
|
||||
&& SECONDARY_MEMORY_NEEDED (class, REGNO_REG_CLASS (regnum),
|
||||
outmode))
|
||||
get_secondary_mem (out, outmode, opnum, type);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
|
|
|
@ -7354,6 +7354,9 @@ gen_reload (out, in, opnum, type)
|
|||
{
|
||||
rtx last = get_last_insn ();
|
||||
rtx tem;
|
||||
#ifdef SECONDARY_MEMORY_NEEDED
|
||||
int in_regnum, out_regnum;
|
||||
#endif
|
||||
|
||||
/* If IN is a paradoxical SUBREG, remove it and try to put the
|
||||
opposite SUBREG on OUT. Likewise for a paradoxical SUBREG on OUT. */
|
||||
|
@ -7516,20 +7519,22 @@ gen_reload (out, in, opnum, type)
|
|||
|
||||
#ifdef SECONDARY_MEMORY_NEEDED
|
||||
/* If we need a memory location to do the move, do it that way. */
|
||||
else if (GET_CODE (in) == REG && REGNO (in) < FIRST_PSEUDO_REGISTER
|
||||
&& GET_CODE (out) == REG && REGNO (out) < FIRST_PSEUDO_REGISTER
|
||||
&& SECONDARY_MEMORY_NEEDED (REGNO_REG_CLASS (REGNO (in)),
|
||||
REGNO_REG_CLASS (REGNO (out)),
|
||||
else if ((in_regnum = true_regnum (in)) >= 0
|
||||
&& in_regnum < FIRST_PSEUDO_REGISTER
|
||||
&& (out_regnum = true_regnum (out)) >= 0
|
||||
&& out_regnum < FIRST_PSEUDO_REGISTER
|
||||
&& SECONDARY_MEMORY_NEEDED (REGNO_REG_CLASS (in_regnum),
|
||||
REGNO_REG_CLASS (out_regnum),
|
||||
GET_MODE (out)))
|
||||
{
|
||||
/* Get the memory to use and rewrite both registers to its mode. */
|
||||
rtx loc = get_secondary_mem (in, GET_MODE (out), opnum, type);
|
||||
|
||||
if (GET_MODE (loc) != GET_MODE (out))
|
||||
out = gen_rtx_REG (GET_MODE (loc), REGNO (out));
|
||||
out = gen_rtx_REG (GET_MODE (loc), out_regnum);
|
||||
|
||||
if (GET_MODE (loc) != GET_MODE (in))
|
||||
in = gen_rtx_REG (GET_MODE (loc), REGNO (in));
|
||||
in = gen_rtx_REG (GET_MODE (loc), in_regnum);
|
||||
|
||||
gen_reload (loc, in, opnum, type);
|
||||
gen_reload (out, loc, opnum, type);
|
||||
|
|
Loading…
Reference in New Issue