Tighten ARM's CANNOT_CHANGE_MODE_CLASS

Submitted by Richard Sandiford on March 25, 2011, 6:27 p.m.

Details

Message ID g4aagjt5qy.fsf@linaro.org
State New
Headers show

Commit Message

Richard Sandiford March 25, 2011, 6:27 p.m.
Richard Earnshaw <rearnsha@arm.com> writes:
>> gcc/
>> 	* config/arm/arm.h (CANNOT_CHANGE_MODE_CLASS): Restrict FPA_REGS
>> 	case to VFPv1.
>> 
>
> I think adding a comment that VFPv1 would require a restriction but that
> that isn't supported would be useful.  Then if the worst happens it will
> be one less bug to go track down.
>
> OK with that change.

Thanks.  Here's what I installed.

Richard


gcc/
	* config/arm/arm.h (CANNOT_CHANGE_MODE_CLASS): Restrict FPA_REGS
	case to VFPv1.

Patch hide | download patch | download mbox

Index: gcc/config/arm/arm.h
===================================================================
--- gcc/config/arm/arm.h	2011-03-25 18:19:45.000000000 +0000
+++ gcc/config/arm/arm.h	2011-03-25 18:26:13.000000000 +0000
@@ -1167,12 +1167,12 @@  #define IRA_COVER_CLASSES						     \
 }
 
 /* FPA registers can't do subreg as all values are reformatted to internal
-   precision.  VFP registers may only be accessed in the mode they
-   were set.  */
-#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS)	\
-  (GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO)		\
-   ? reg_classes_intersect_p (FPA_REGS, (CLASS))	\
-     || reg_classes_intersect_p (VFP_REGS, (CLASS))	\
+   precision.  In VFPv1, VFP registers could only be accessed in the mode
+   they were set, so subregs would be invalid there too.  However, we don't
+   support VFPv1 at the moment, and the restriction was lifted in VFPv2.  */
+#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS)		\
+  (GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO)			\
+   ? reg_classes_intersect_p (FPA_REGS, (CLASS))		\
    : 0)
 
 /* The class value for index registers, and the one for base regs.  */