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: [PATCH, ARM] Work around out-of-range branch error for Thumb-2


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.


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