This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [arm] Failure with 64-bit HWI
- From: Richard Earnshaw <rearnsha at gcc dot gnu dot org>
- To: Paul Brook <paul at codesourcery dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, Mark Mitchell <mark at codesourcery dot com>
- Date: Mon, 13 Sep 2004 11:58:55 +0100
- Subject: Re: [arm] Failure with 64-bit HWI
- Organization: GNU
- References: <200409121838.42982.paul@codesourcery.com>
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.