summaryrefslogtreecommitdiff
path: root/gcc/config/cris
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-10-16 04:41:41 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-10-16 04:41:41 +0000
commitd286588b498802ef740f5a5f7811cf6108cbbb86 (patch)
tree04eb53b2ba38d738a1c6ea562be92c9431cee008 /gcc/config/cris
parent79037a16e0df1368045c4d1aa939629cae186d5f (diff)
downloadgcc-d286588b498802ef740f5a5f7811cf6108cbbb86.tar.gz
2009-10-16 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 152888 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@152889 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/cris')
-rw-r--r--gcc/config/cris/cris.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h
index 586f7ff2077..76ebcefbae7 100644
--- a/gcc/config/cris/cris.h
+++ b/gcc/config/cris/cris.h
@@ -630,12 +630,17 @@ enum reg_class
? 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