From: peter@lasergraph-dsp.de
To: gcc@gcc.gnu.org
Bcc: peter@lasergraph-dsp.de
Subject: Re: gcc 3.4.0 m68k-elf generates illegal code for ColdFire (maybe a fix)
Date: Thu, 27 May 2004 16:18:29 +0200

Dear gcc gurus,

since no one wants to handle the old illegal code generation issue (it
seems
it existed since 2002), I tried to find it myself. I might have found it:
In reload.c (find_reloads) a force reload needs IMHO to be forced not
only
for memory operands, but also for pseudo registers, which also reside in
memory.

Can someone with deeper understanding of gcc verify that this assumption
is
correct and does not break any other code?

Here is a patch:

-------------------------------------------------------------------------------
2004-05-27  Peter Jakubek  <peter@laseranimation.com>

	* reload.c (find_reloads): Force reload for pseudo registers on big
	endian machines.

diff -ru gcc.orig/gcc/reload.c gcc/gcc/reload.c
--- gcc.orig/gcc/reload.c    2004-03-10 02:51:01.000000000 +0100
+++ gcc/gcc/reload.c    2004-05-27 13:07:32.828125000 +0200
@@ -2947,7 +2947,7 @@
                 < BIGGEST_ALIGNMENT)
                && (GET_MODE_SIZE (operand_mode[i])
                    > GET_MODE_SIZE (GET_MODE (operand))))
-              || (GET_CODE (operand) == MEM && BYTES_BIG_ENDIAN)
+              || BYTES_BIG_ENDIAN
 #ifdef LOAD_EXTEND_OP
               || (GET_MODE_SIZE (operand_mode[i]) <= UNITS_PER_WORD
                   && (GET_MODE_SIZE (GET_MODE (operand))




Best regards,

Peter Jakubek
LaserAnimation Sollinger GmbH
peter@lasergraph-dsp.de

