This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[m32c] fix CANNOT_CHANGE_MODE_CLASS
- From: DJ Delorie <dj at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 25 Jan 2007 20:17:00 -0500
- Subject: [m32c] fix CANNOT_CHANGE_MODE_CLASS
Applied.
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.
Index: config/m32c/m32c.c
===================================================================
--- config/m32c/m32c.c (revision 121197)
+++ config/m32c/m32c.c (working copy)
@@ -846,11 +846,19 @@
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);