]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
arm.h (CANNOT_CHANGE_MODE_CLASS): Avoid subreg'ing VFP D registers in big-endian...
authorJulian Brown <julian@codesourcery.com>
Mon, 22 Oct 2012 11:32:37 +0000 (11:32 +0000)
committerJulian Brown <jules@gcc.gnu.org>
Mon, 22 Oct 2012 11:32:37 +0000 (11:32 +0000)
* config/arm/arm.h (CANNOT_CHANGE_MODE_CLASS): Avoid subreg'ing
VFP D registers in big-endian mode.

From-SVN: r192687

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

index c4a0099bb97d20d08b1263ef141ecda77df2085b..d8db9c9f0ba1129170084e171d9f118b493bfb04 100644 (file)
@@ -1,3 +1,8 @@
+2012-10-22  Julian Brown  <julian@codesourcery.com>
+
+       * config/arm/arm.h (CANNOT_CHANGE_MODE_CLASS): Avoid subreg'ing
+       VFP D registers in big-endian mode.
+
 2012-10-22  Georg-Johann Lay  <avr@gjlay.de>
 
        * doc/invoke.texi (AVR Options): Document __AVR_ARCH__.
index 4ac5de70862f13a47f38d10f424c7843f3478ce6..08eeff5c8d3cc55c94e5d881eed3c4f663d0f929 100644 (file)
@@ -1205,8 +1205,15 @@ enum reg_class
 /* In VFPv1, VFP registers could only be accessed in the mode they
    were set, so subregs would be invalid there.  However, we don't
    support VFPv1 at the moment, and the restriction was lifted in
-   VFPv2.  */
-#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) 0
+   VFPv2.
+   In big-endian mode, modes greater than word size (i.e. DFmode) are stored in
+   VFP registers in little-endian order.  We can't describe that accurately to
+   GCC, so avoid taking subregs of such values.  */
+#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS)      \
+  (TARGET_VFP && TARGET_BIG_END                                \
+   && (GET_MODE_SIZE (FROM) > UNITS_PER_WORD           \
+       || GET_MODE_SIZE (TO) > UNITS_PER_WORD)         \
+   && reg_classes_intersect_p (VFP_REGS, (CLASS)))
 
 /* The class value for index registers, and the one for base regs.  */
 #define INDEX_REG_CLASS  (TARGET_THUMB1 ? LO_REGS : GENERAL_REGS)