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
This commit is contained in:
DJ Delorie 2007-01-25 20:16:57 -05:00 committed by DJ Delorie
parent 21f14ff955
commit db9c839733
2 changed files with 11 additions and 0 deletions

View File

@ -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.

View File

@ -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);