]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
arm.h (BASE_REG_CLASS): Always return LO_REGS for Thumb.
authorRichard Earnshaw <rearnsha@arm.com>
Mon, 30 Sep 2002 11:54:00 +0000 (11:54 +0000)
committerRichard Earnshaw <rearnsha@gcc.gnu.org>
Mon, 30 Sep 2002 11:54:00 +0000 (11:54 +0000)
* arm.h (BASE_REG_CLASS): Always return LO_REGS for Thumb.
(MODE_BASE_REG_CLASS, case Thumb): Only return BASE_REGS if we know
that we have a SImode access, and only then if reload hasn't completed;
for all other cases, use LO_REGS.

From-SVN: r57645

gcc/ChangeLog
gcc/config/arm/arm.h

index 97d5b9897d2225d10d0dfd3fe7e76750aa0143fc..c6c0076be67b238e41ead065db241ed783ffa5b9 100644 (file)
@@ -1,3 +1,10 @@
+2002-09-30  Richard Earnshaw  <rearnsha@arm.com>
+
+       * arm.h (BASE_REG_CLASS): Always return LO_REGS for Thumb.
+       (MODE_BASE_REG_CLASS, case Thumb): Only return BASE_REGS if we know
+       that we have a SImode access, and only then if reload hasn't completed;
+       for all other cases, use LO_REGS.
+
 2002-09-29  David S. Miller  <davem@redhat.com>
 
        * config/sparc/linux64.h (STARTFILE_SPEC32, ENDFILE_SPEC32): Kill
index 5e8b5d91cd07e14cfa7249de1d4334860a246338..c5431b537d5c21da70f1ee4d0448e745b5251e76 100644 (file)
@@ -1093,14 +1093,16 @@ enum reg_class
 
 /* The class value for index registers, and the one for base regs.  */
 #define INDEX_REG_CLASS  (TARGET_THUMB ? LO_REGS : GENERAL_REGS)
-#define BASE_REG_CLASS   (TARGET_THUMB ? BASE_REGS : GENERAL_REGS)
+#define BASE_REG_CLASS   (TARGET_THUMB ? LO_REGS : GENERAL_REGS)
 
-/* For the Thumb the high registers cannot be used as base
-   registers when addressing quanitities in QI or HI mode.  */
+/* For the Thumb the high registers cannot be used as base registers
+   when addressing quanitities in QI or HI mode; if we don't know the
+   mode, then we must be conservative.  After reload we must also be
+   conservative, since we can't support SP+reg addressing, and we
+   can't fix up any bad substitutions.  */
 #define MODE_BASE_REG_CLASS(MODE)                                      \
-    (TARGET_ARM ? BASE_REGS :                                          \
-     (((MODE) == QImode || (MODE) == HImode || (MODE) == VOIDmode)     \
-     ? LO_REGS : BASE_REGS))
+    (TARGET_ARM ? GENERAL_REGS :                                       \
+     (((MODE) == SImode && !reload_completed) ? BASE_REGS : LO_REGS))
 
 /* When SMALL_REGISTER_CLASSES is nonzero, the compiler allows
    registers explicitly used in the rtl to be used as spill registers