Failed cross: Alpha->ARM

Richard Earnshaw rearnsha@arm.com
Tue Dec 16 10:08:00 GMT 1997


gilbertd@treblig.org said:
> Hi,
>   Host: Alpha Linux RedHat 5.0
>   Target: ARM Linux
>   Problem: Constant greater than 2^32 generated in assembler file
>   Suspected cause: Converting a -1 to 2^32 and then propogating the
>   value.
> ----------------------------------------------------
> Example source file: 
> typedef struct {
>   int a[10];
> } foo;
>
> foo* x;
> static foo y[128];
>
> int a() {
>   do {
>   } while (x < y + 128-1);
> }; 


Stephen Williams <steve@icarus.icarus.com> wrote:
>   Host: Alpha Linux RedHat 5.0
>   Target: ARM Linux
>   Problem: Constant greater than 2^32 generated in assembler file
>   Suspected cause: Converting a -1 to 2^32 and then propogating the value.
> 
> Try this patch. (In spite of the name, it does apply to the egcs-1.0
> sources.) As I understand it, it does indeed mess up detecting if the
> constant that is can load in a simple instruction or requires more
> complex handling. Here is a ChangeLog and the patch itself.
> 
> Mon Oct 20 08:49:16 1997  Stephen Williams  <steve@icarus.com>
> 
>        * gcc/config/arm/arm.c: Fixed problem with 64bit hosts generating
>        bogus assembler for long long constants.
> 
> 

First this patch doesn't fix the problem.  Second it is wrong, since it 
doesn't take into account assumptions elsewhere about use of HOST_WIDE_INT 
when that is more than 32-bits.  (The latest egcs snapshot contains the 
correct fixes for this).

The patch below fixes the problem reported.

Tue Dec 16 17:13:43 1997  Richard Earnshaw (rearnsha@arm.com)

	* explow.c (plus_constant_wide, case PLUS): Truncate any sum of
	two integers to the width of the mode.





More information about the Gcc mailing list