gcc 3.4.0 m68k-elf generates illegal code for ColdFire (maybe a fix)
Bernardo Innocenti
bernie@develer.com
Tue Jun 1 21:59:00 GMT 2004
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/
More information about the Gcc
mailing list