This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
make combine honour CLASS_CANNOT_CHANGE_SIZE
- To: gcc-patches at gcc dot gnu dot org
- Subject: make combine honour CLASS_CANNOT_CHANGE_SIZE
- From: Geoff Keating <geoffk at cygnus dot com>
- Date: Fri, 26 May 2000 18:49:52 -0700
The attached patch stops combine from substituting a hard register
which is in CLASS_CANNOT_CHANGE_SIZE into an expression that changes
the register's size.
Bootstrapped and passed testsuite on alpha-linux, also passes
testsuite on x86-linux X powerpc-eabisim, originally developed under
powerpc-ibm-aix4.3.3.0 and seemed to work there too in both 32-bit and
64-bit modes.
OK to commit?
--
- Geoffrey Keating <geoffk@cygnus.com>
===File ~/patches/cygnus/rs6000-64bugs2-combine.patch=======
2000-05-18 Geoff Keating <geoffk@cygnus.com>
* combine.c (subst): Honour CLASS_CANNOT_CHANGE_SIZE when
substituting the REG in a (subreg:X (reg:Y ...)).
Index: combine.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/combine.c,v
retrieving revision 1.129
diff -u -p -r1.129 combine.c
--- combine.c 2000/05/23 08:41:38 1.129
+++ combine.c 2000/05/24 23:36:29
@@ -3400,6 +3400,18 @@ subst (x, from, to, in_dest, unique_copy
)
return gen_rtx_CLOBBER (VOIDmode, const0_rtx);
+#ifdef CLASS_CANNOT_CHANGE_SIZE
+ if (code == SUBREG
+ && GET_CODE (to) == REG
+ && REGNO (to) < FIRST_PSEUDO_REGISTER
+ && (TEST_HARD_REG_BIT
+ (reg_class_contents[(int) CLASS_CANNOT_CHANGE_SIZE],
+ REGNO (to)))
+ && (GET_MODE_BITSIZE (GET_MODE (to))
+ != GET_MODE_BITSIZE (GET_MODE (x))))
+ return gen_rtx_CLOBBER (VOIDmode, const0_rtx);
+#endif
+
new = (unique_copy && n_occurrences ? copy_rtx (to) : to);
n_occurrences++;
}
============================================================