This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, ARM] Work around out-of-range branch error for Thumb-2
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Julian Brown <julian at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org, dan at codesourcery dot com, paul at codesourcery dot com
- Date: Fri, 04 Dec 2009 19:07:55 +0000
- Subject: Re: [PATCH, ARM] Work around out-of-range branch error for Thumb-2
- References: <20091127165811.6d09a1f1@rex.config> <1259341531.9961.68.camel@e200601-lin.cambridge.arm.com> <20091204190452.0340f1d5@rex.config>
On Fri, 2009-12-04 at 19:04 +0000, Julian Brown wrote:
> On Fri, 27 Nov 2009 17:05:31 +0000
> Richard Earnshaw <rearnsha@arm.com> wrote:
>
> > On Fri, 2009-11-27 at 16:58 +0000, Julian Brown wrote:
> > > gcc/
> > > * config/arm/thumb2.md (thumb2_addsi_short): Change length to 4.
> >
> > This seems wrong to me; and it's just papering over a bug elsewhere.
> > Why is regrename not verifying the constraints properly?
>
> Probably because the constraints are too permissive (as Andrew Pinski
> pointed out).
>
> This version splits the constraints into two parts, corresponding to
> the two different short-add-immediate instructions. I've added new
> constraints to cover the represented immediates exactly too, just to be
> safe ("Ps" for 8-bit immediates for addition or subtraction, "Pt"
> similar for 3-bit immediates), since such constraints weren't available
> in Thumb-2 mode.
>
> I've verified that this patch still fixes the original test case, and
> re-tested with a cross-compiler to ARM EABI. OK now?
>
> Julian
>
> ChangeLog
>
> * gcc/config/arm/constraints.md (Ps, Pt): New constraint letters.
> (*thumb2_addsi_short): Tighten constraints.
- (set_attr "length" "2")]
+ (set_attr "length" "2,2")]
There's no need to repeat an attribute if it's the same for all cases.
Otherwise, OK
R.