From: David S. Miller Date: Wed, 2 Oct 2002 03:40:35 +0000 (-0700) Subject: reload1.c (gen_reload:SECONDARY_MEMORY_NEEDED): Handle SUBREG. X-Git-Tag: releases/gcc-3.2.1~221 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5765b16f48a26c312239589bf7bd9b4f8b594b55;p=thirdparty%2Fgcc.git reload1.c (gen_reload:SECONDARY_MEMORY_NEEDED): Handle SUBREG. 2002-10-01 David S. Miller Jan Hubicka * reload1.c (gen_reload:SECONDARY_MEMORY_NEEDED): Handle SUBREG. * reload.c (push_reload:SECONDARY_MEMORY_NEEDED): Likewise. Co-Authored-By: Jan Hubicka From-SVN: r57721 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 19088789f270..e662d8244ae7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2002-10-01 David S. Miller + Jan Hubicka + + * reload1.c (gen_reload:SECONDARY_MEMORY_NEEDED): Handle SUBREG. + * reload.c (push_reload:SECONDARY_MEMORY_NEEDED): Likewise. + 2002-09-30 Bob Wilson * config/xtensa/xtensa.h (REG_CLASS_NAMES, REG_CLASS_CONTENTS): diff --git a/gcc/reload.c b/gcc/reload.c index 5880dfb6fa3f..80678d0d7b9a 100644 --- a/gcc/reload.c +++ b/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 diff --git a/gcc/reload1.c b/gcc/reload1.c index 0ce10c4c3af7..001d3edf142b 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -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);