This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [arm] Failure with 64-bit HWI


On Sun, 2004-09-12 at 18:38, Paul Brook wrote:
> arm_expand_prologue uses an "unsigned int args_to_push". It then does
> GEN_INT (-args_to_push). This gives the wrong answer with a 64-bit 
> HOST_WIDE_INT because the negated 32-bit value is zero extended, resulting in 
> bogus prologue instructions such as
>         sub     fp, ip, #-4294967292
> instead of
>         sub     fp, ip, #4
> 
> The patch below fixes this by making args_to_push a (signed) "int" variable.
> 
> Th variable is set from an "int" value anyway, so this should be safe. The 
> alternative is to make it a H_W_I, or insert casts to force correct value 
> extension at use.
> 
> Tested with cross to arm-none-eabi.
> Ok?
> 
> Paul
> 
> 2004-09-12  Paul Brook  <paul@codesourcery.com>
> 
>  * config/arm/arm.c (arm_expand_prologue): Make args_to_push signed.

I think it would be better to make it an 'unsigned H_W_I'.  It was made
unsigned to avoid unnecessary signed value handling when doing the
division by four.

R.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]