This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
optimization/7702: [PATCH] Make reload-cse honor CANNOT_CHANGE_MODE_CLASS
- From: Falk Hueffner <falk dot hueffner at student dot uni-tuebingen dot de>
- To: nobody at gcc dot gnu dot org
- Cc: gcc-prs at gcc dot gnu dot org,
- Date: 14 Feb 2003 09:36:01 -0000
- Subject: optimization/7702: [PATCH] Make reload-cse honor CANNOT_CHANGE_MODE_CLASS
- Reply-to: Falk Hueffner <falk dot hueffner at student dot uni-tuebingen dot de>
The following reply was made to PR optimization/7702; it has been noted by GNATS.
From: Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
To: gcc-patches@gcc.gnu.org
Cc: gcc-gnats@gcc.gnu.org, bfkelly@nsa.gov
Subject: optimization/7702: [PATCH] Make reload-cse honor CANNOT_CHANGE_MODE_CLASS
Date: 14 Feb 2003 10:25:54 +0100
--=-=-=
Hi,
This fixes PR 7702 and a miscompilation of openssh on Alpha ev6 (sshd
wouldn't accept ssh2 connections). The CSE in reload wants to merge
registers with equal content and widen them to word_mode while at it,
but doesn't honor CANNOT_CHANGE_MODE_CLASS. When the register
allocator is foolish enough to put two identical integer constants
into floating point registers, this fails.
Because of this dependency on the register allocator, the problem is
very hard to isolate, both test cases work with mainline. However,
doing an equivalent patch for 3.2 fixes the problem. Because of the
ssh miscompilation, it would be nice if it could also be included on
older branches.
2003-02-14 Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
PR optimization/7702
* reload1.c (reload_cse_simplify_set): Honor
CANNOT_CHANGE_MODE_CLASS.
--
Falk
--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=reload1.patch
Index: reload1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/reload1.c,v
retrieving revision 1.378
diff -u -r1.378 reload1.c
--- reload1.c 11 Feb 2003 03:52:28 -0000 1.378
+++ reload1.c 13 Feb 2003 21:39:16 -0000
@@ -8282,7 +8282,13 @@
{
#ifdef LOAD_EXTEND_OP
if (GET_MODE_BITSIZE (GET_MODE (SET_DEST (set))) < BITS_PER_WORD
- && extend_op != NIL)
+ && extend_op != NIL
+#ifdef CANNOT_CHANGE_MODE_CLASS
+ && !CANNOT_CHANGE_MODE_CLASS (GET_MODE (SET_DEST (set)),
+ word_mode,
+ REGNO_REG_CLASS (REGNO (SET_DEST (set))))
+#endif
+ )
{
rtx wide_dest = gen_rtx_REG (word_mode, REGNO (SET_DEST (set)));
ORIGINAL_REGNO (wide_dest) = ORIGINAL_REGNO (SET_DEST (set));
--=-=-=--