]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Backport two changes to the 2.95 branch
authorBernd Schmidt <bernds@redhat.co.uk>
Thu, 30 Nov 2000 12:20:44 +0000 (12:20 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Thu, 30 Nov 2000 12:20:44 +0000 (12:20 +0000)
From-SVN: r37885

gcc/ChangeLog
gcc/reload.c

index 607a0a6e3e32ec3b502b34e46342e9ab3edfd505..52ae16e8b57cb9dba107aa8fc2ee47a67ff2287a 100644 (file)
@@ -1,5 +1,14 @@
 2000-11-30  Bernd Schmidt  <bernds@redhat.co.uk>
 
+       Thu Jul  6 18:30:36 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
+       * reload.c (push_reload): When seeing if can reuse a register,
+       check extra registers against widest of INMODE and OUTMODE.
+
+       1999-11-29  Bernd Schmidt  <bernds@redhat.co.uk>
+       * reload.c (push_reload): When looking for a register to put into
+       reg_rtx, make sure all hard regs in a multi-reg register are in the
+       right class and nonfixed.
+
        1999-11-29  Joern Rennecke  <amylaar@redhat.co.uk>
        * reload1.c (reloads_conflict): Reverse test comparing operand
        numbers when testing for conflict between output/outaddr reloads.
index 7c2c14e65c913166de4c3d8ebc1ab158ed8f2c36..689acaa2ec3c2bccd6adfb3325fe6198fba932da 100644 (file)
@@ -1535,12 +1535,23 @@ push_reload (in, out, inloc, outloc, class,
            && GET_MODE_SIZE (inmode) <= GET_MODE_SIZE (GET_MODE (XEXP (note, 0)))
            && HARD_REGNO_MODE_OK (regno, inmode)
            && GET_MODE_SIZE (outmode) <= GET_MODE_SIZE (GET_MODE (XEXP (note, 0)))
-           && HARD_REGNO_MODE_OK (regno, outmode)
-           && TEST_HARD_REG_BIT (reg_class_contents[(int) class], regno)
-           && !fixed_regs[regno])
+           && HARD_REGNO_MODE_OK (regno, outmode))
          {
-           reload_reg_rtx[i] = gen_rtx_REG (inmode, regno);
-           break;
+           unsigned int offs;
+           unsigned int nregs = MAX (HARD_REGNO_NREGS (regno, inmode),
+                                     HARD_REGNO_NREGS (regno, outmode));
+
+           for (offs = 0; offs < nregs; offs++)
+             if (fixed_regs[regno + offs]
+                 || ! TEST_HARD_REG_BIT (reg_class_contents[(int) class],
+                                         regno + offs))
+               break;
+
+           if (offs == nregs)
+             {
+               reload_reg_rtx[i] = gen_rtx_REG (inmode, regno);
+               break;
+             }
          }
     }