This is the mail archive of the
mailing list for the GCC project.
Re: fix PR 10730
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Philip Blundell <pb at nexus dot co dot uk>
- Cc: gcc-patches at gcc dot gnu dot org, Richard dot Earnshaw at arm dot com
- Date: Mon, 12 May 2003 11:42:35 +0100
- Subject: Re: fix PR 10730
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
> The problem here is an out-of-range access to a constant pool. It comes
> about because the arith_adjacentmem pattern is trying to output "add rN,
> rN, #BIGCONST"; this gets split into multiple smaller adds, and hence we
> end up with more instructions than the length attribute is admitting to.
> Winding up the advertised length would be one option, but it seems
> better just to suppress use of this pattern in those cases.
> 2003-05-11 Philip Blundell <email@example.com>
> * config/arm/arm.c (adjacent_mem_locations): Reject offsets
> involving invalid constants. [PR 10730]
> Index: config/arm/arm.c
> RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.c,v
> retrieving revision 1.271
> diff -u -p -r1.271 arm.c
> --- config/arm/arm.c 10 May 2003 13:10:46 -0000 1.271
> +++ config/arm/arm.c 11 May 2003 12:30:31 -0000
> @@ -4567,6 +4571,12 @@ adjacent_mem_locations (a, b)
> reg1 = REGNO (XEXP (b, 0));
> + /* Don't accept any offset that will require multiple instructions to handle,
> + since this would cause the arith_adjacentmem pattern to output an overlong
> + sequence. */
> + if (!const_ok_for_arm (val0) || !const_ok_for_arm (val1))
> + return 0;
> return (reg0 == reg1) && ((val1 - val0) == 4 || (val0 - val1) == 4);
> return 0;
This is overly restrictive: a subtract-immediate instruction can be used,
so the test should be const_ok_for_op (PLUS, val).