Commit db9c8397 by DJ Delorie Committed by DJ Delorie

m32c.c (m32c_cannot_change_mode_class): We don't allow changes to modes which…

m32c.c (m32c_cannot_change_mode_class): We don't allow changes to modes which don't fit in those registers.

* config/m32c/m32c.c (m32c_cannot_change_mode_class): We don't
allow changes to modes which don't fit in those registers.

From-SVN: r121199
parent 21f14ff9
2007-01-25 DJ Delorie <dj@redhat.com> 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 * reload1.c (choose_reload_regs): Check for invalid subregs before
computing their locations, not after. computing their locations, not after.
......
...@@ -846,11 +846,19 @@ int ...@@ -846,11 +846,19 @@ int
m32c_cannot_change_mode_class (enum machine_mode from, m32c_cannot_change_mode_class (enum machine_mode from,
enum machine_mode to, int rclass) enum machine_mode to, int rclass)
{ {
int rn;
#if DEBUG0 #if DEBUG0
fprintf (stderr, "cannot change from %s to %s in %s\n", fprintf (stderr, "cannot change from %s to %s in %s\n",
mode_name[from], mode_name[to], class_names[rclass]); mode_name[from], mode_name[to], class_names[rclass]);
#endif #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) if (to == QImode)
return (class_contents[rclass][0] & 0x1ffa); return (class_contents[rclass][0] & 0x1ffa);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment