summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authordj <dj@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-26 01:16:57 +0000
committerdj <dj@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-26 01:16:57 +0000
commitced4068a806f214d43721e310d16b361e011b925 (patch)
treea30dc8dad6329edbcb6b7666db96ff78e7727b67 /gcc
parentf82c9309b58e52344feb2159db842c8c78b6f562 (diff)
downloadgcc-ced4068a806f214d43721e310d16b361e011b925.tar.gz
* config/m32c/m32c.c (m32c_cannot_change_mode_class): We don't
allow changes to modes which don't fit in those registers. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121199 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog3
-rw-r--r--gcc/config/m32c/m32c.c8
2 files changed, 11 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4cf04ef2a00..25223c872b5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,8 @@
2007-01-25 DJ Delorie <dj@redhat.com>
+ * config/m32c/m32c.c (m32c_cannot_change_mode_class): We don't
+ allow changes to modes which don't fit in those registers.
+
* reload1.c (choose_reload_regs): Check for invalid subregs before
computing their locations, not after.
diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c
index de5f22aa6db..b28d7473e5e 100644
--- a/gcc/config/m32c/m32c.c
+++ b/gcc/config/m32c/m32c.c
@@ -846,11 +846,19 @@ int
m32c_cannot_change_mode_class (enum machine_mode from,
enum machine_mode to, int rclass)
{
+ int rn;
#if DEBUG0
fprintf (stderr, "cannot change from %s to %s in %s\n",
mode_name[from], mode_name[to], class_names[rclass]);
#endif
+ /* If the larger mode isn't allowed in any of these registers, we
+ can't allow the change. */
+ for (rn = 0; rn < FIRST_PSEUDO_REGISTER; rn++)
+ if (class_contents[rclass][0] & (1 << rn))
+ if (! m32c_hard_regno_ok (rn, to))
+ return 1;
+
if (to == QImode)
return (class_contents[rclass][0] & 0x1ffa);