(choose_reload_regs): If EQUIV is a SUBREG, make a new REG.
authorRichard Kenner <kenner@gcc.gnu.org>
Wed, 23 Feb 1994 13:13:48 +0000 (08:13 -0500)
committerRichard Kenner <kenner@gcc.gnu.org>
Wed, 23 Feb 1994 13:13:48 +0000 (08:13 -0500)
From-SVN: r6612

gcc/reload1.c

index 503ebe3..ac75a51 100644 (file)
@@ -5044,9 +5044,12 @@ choose_reload_regs (insn, avoid_return_reg)
                    regno = REGNO (equiv);
                  else if (GET_CODE (equiv) == SUBREG)
                    {
-                     regno = REGNO (SUBREG_REG (equiv));
-                     if (regno < FIRST_PSEUDO_REGISTER)
-                       regno += SUBREG_WORD (equiv);
+                     /* This must be a SUBREG of a hard register.
+                        Make a new REG since this might be used in an
+                        address and not all machines support SUBREGs
+                        there.  */
+                     regno = REGNO (SUBREG_REG (equiv)) + SUBREG_WORD (equiv);
+                     equiv = gen_rtx (REG, reload_mode[r], regno);
                    }
                  else
                    abort ();