]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
reload1.c (gen_reload:SECONDARY_MEMORY_NEEDED): Handle SUBREG.
authorDavid S. Miller <davem@redhat.com>
Wed, 2 Oct 2002 03:40:35 +0000 (20:40 -0700)
committerDavid S. Miller <davem@gcc.gnu.org>
Wed, 2 Oct 2002 03:40:35 +0000 (20:40 -0700)
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

gcc/ChangeLog
gcc/reload.c
gcc/reload1.c

index 19088789f270b73e16e05fb923c86d22de294d50..e662d8244ae739616fce015a2e9be2009f933a28 100644 (file)
@@ -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):
index 5880dfb6fa3ff86842d85c087368592aeaedc8dd..80678d0d7b9ab7abd43a0ad60dbe0a6820fe1e21 100644 (file)
@@ -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
index 0ce10c4c3af77fc20e8cc6a466f33f47c1287cfc..001d3edf142b4326a1cd6b20f0eb4e93ee1d3bab 100644 (file)
@@ -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);