From: DJ Delorie Date: Fri, 26 Jan 2007 01:16:57 +0000 (-0500) Subject: m32c.c (m32c_cannot_change_mode_class): We don't allow changes to modes which don... X-Git-Tag: releases/gcc-4.3.0~7241 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=db9c839733fa461c08576e7fbbd0e305af7fecfb;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4cf04ef2a001..25223c872b55 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,8 @@ 2007-01-25 DJ Delorie + * 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 de5f22aa6db9..b28d7473e5e2 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);