This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc 3.4.0 m68k-elf generates illegal code for ColdFire (maybea fix)
- From: Bernardo Innocenti <bernie at develer dot com>
- To: Peter Jakubek <peter at lasergraph-dsp dot de>
- Cc: gcc at gcc dot gnu dot org, Peter Barada <peter at baradas dot org>, Richard Henderson <rth at redhat dot com>
- Date: Tue, 01 Jun 2004 23:59:54 +0200
- Subject: Re: gcc 3.4.0 m68k-elf generates illegal code for ColdFire (maybea fix)
- Organization: Develer S.r.l.
- References: <E1BTLiH-00086h-00@mrelay01.kundenservices.net> <40BC8EBC.7070301@develer.com> <40BCB925.8080600@lasergraph-dsp.de>
Peter Jakubek wrote:
Bernardo Innocenti wrote:
By removing the "GET_CODE (operand) == MEM" check
you're maybe underspecifying the condition. The operand
may also be an immediate or a hard register.
Maybe this?
|| BYTES_BIG_ENDIAN
&& (GET_CODE (operand) == MEM)
|| (GET_CODE(operand) == REG
&& REGNO(operand) >= FIRST_PSEUDO_REGISTER))
I don't think this is needed. If you review the full if () statement
you will see there is a test for MEM/PSEUDO REG above already.
I see. I should have gone in reload.c and see the
full thing. Now I see you were right.
Unfortunately, I can't regtest any patches right
now because both 3_4-branch and mainline are
currently broken on the m68k.
Richard, do you approve this patch for mainline?
(I've slightly edited the ChangeLog entry
and removed the extra parentheses).
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))
Here is a reformatted version that makes the nesting/operator precedence
more clear:
|| ( ( GET_CODE (operand) == MEM
|| ( GET_CODE (operand) == REG
&& REGNO (operand) >= FIRST_PSEUDO_REGISTER))
#ifndef WORD_REGISTER_OPERATIONS
&& ( ( ( GET_MODE_BITSIZE (GET_MODE (operand))
< BIGGEST_ALIGNMENT)
&& ( GET_MODE_SIZE (operand_mode[i])
> GET_MODE_SIZE (GET_MODE (operand))))
|| (/*GET_CODE (operand) == MEM &&*/ BYTES_BIG_ENDIAN)
#ifdef LOAD_EXTEND_OP
|| ( GET_MODE_SIZE (operand_mode[i]) <= UNITS_PER_WORD
&& ( GET_MODE_SIZE (GET_MODE (operand))
<= UNITS_PER_WORD)
&& ( GET_MODE_SIZE (operand_mode[i])
> GET_MODE_SIZE (GET_MODE (operand)))
&& INTEGRAL_MODE_P (GET_MODE (operand))
&& LOAD_EXTEND_OP (GET_MODE (operand)) != NIL)
#endif
)
#endif
)
--
// Bernardo Innocenti - Develer S.r.l., R&D dept.
\X/ http://www.develer.com/