[PATCH, ARM] Work around out-of-range branch error for Thumb-2

Paul Brook paul@codesourcery.com
Fri Nov 27 18:59:00 GMT 2009


On Friday 27 November 2009, Richard Earnshaw wrote:
> On Fri, 2009-11-27 at 16:58 +0000, Julian Brown wrote:
> > Hi,
> >
> > This patch works around an issue which can cause the
> > *thumb2_addsi_short pattern to expand to a 4-byte instruction after the
> > regrename pass rather than a 2-byte instruction (as specified in its
> > length attribute). These instructions are created by a peephole2 (";;
> > 16-bit add/sub immediate") with the correct predicates/conditions for
> > (two different) 16-bit opcodes, but the regrename pass runs afterwards
> > and can rewrite the destination register such that a four-byte insn is
> > needed to represent the operation in some cases.

> This seems wrong to me; and it's just papering over a bug elsewhere.
> Why is regrename not verifying the constraints properly?

IIRC the real bug is that the instruction predicates (possibly constraints) 
are too lax and allow some wide instructions. This is definitely a quick hack 
rather than a proper fix.

Paul



More information about the Gcc-patches mailing list