diff gcc/config/cris/cris.h @ 36:855418dad1a3

gcc-4.4-20091020
author e075725
date Tue, 22 Dec 2009 21:19:31 +0900
parents a06113de4d67
children 77e2b8dfacca
line wrap: on
line diff
--- a/gcc/config/cris/cris.h	Thu Sep 24 13:21:57 2009 +0900
+++ b/gcc/config/cris/cris.h	Tue Dec 22 21:19:31 2009 +0900
@@ -644,12 +644,17 @@
   ? GENERAL_REGS : (CLASS))
 
 /* We can't move special registers to and from memory in smaller than
-   word_mode.  */
-#define SECONDARY_RELOAD_CLASS(CLASS, MODE, X)		\
-  (((CLASS) != SPECIAL_REGS && (CLASS) != MOF_REGS)	\
-   || GET_MODE_SIZE (MODE) == 4				\
-   || !MEM_P (X)					\
-   ? NO_REGS : GENERAL_REGS)
+   word_mode.  We also can't move between special registers.  Luckily,
+   -1, as returned by true_regnum for non-sub/registers, is valid as a
+   parameter to our REGNO_REG_CLASS, returning GENERAL_REGS, so we get
+   the effect that any X that isn't a special-register is treated as
+   a non-empty intersection with GENERAL_REGS.  */
+#define SECONDARY_RELOAD_CLASS(CLASS, MODE, X)				\
+ ((((CLASS) == SPECIAL_REGS || (CLASS) == MOF_REGS)			\
+   && ((GET_MODE_SIZE (MODE) < 4 && MEM_P (X))				\
+       || !reg_classes_intersect_p (REGNO_REG_CLASS (true_regnum (X)),	\
+				    GENERAL_REGS)))			\
+   ? GENERAL_REGS : NO_REGS)
 
 /* FIXME: Fix regrename.c; it should check validity of replacements,
    not just with a silly pass-specific macro.  We may miss some