This is the mail archive of the gcc@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]

Re: ARM Thumb byte stores


What happened to this patch? Can it go into gcc 3.0.1 please?

Jifl

Richard Earnshaw wrote:
> 
> > Richard Earnshaw wrote:
> > >
> > > > > This is a bug in gcc.  There is no strb instruction that stores to the
> > > > > stack in thumb mode.  It was fixed (I hope) in the cvs in early December:
> > > >
> > > > My problem was with cvs gcc yesterday :). I'm still trying to get a small
> > > > test case to reproduce the problem.
> > > >
> > >
> > > Drat.  I thought that problem was behind us...  A test case is going to be
> > > need before I can progress this.  My guess is that it is likely to be some
> > > sort of reload problem, so it may be hard to whittle it down to a very
> > > short function.
> >
> > [ much time passes ]
> >
> > I have the test case now:
> 
> Thanks.
> 
> The problem occurs because we have r8 (a high register) equal to sp; so
> when we try to reload the store (which is based off r8), we substitute in
> SP, since it is in BASE_REGS_CLASS and hence 'a valid alternative'.
> 
> Here is what I think should be a suitable patch.  I've run some code
> through it, and it doesn't seem to cause anything horrible to happen; but
> messing around with the register classes is fraught with potential
> problems, so this may throw up something I haven't considered.  However,
> the AVR port seems to manage without having the stack pointer part of
> BASE_REG_CLASS, so maybe thumb compiles can too.
> 
> This change does not seem to prevent sp from being used as an address
> register at other times, but it should stop it being used for this purpose
> when we need to push a reload.
> 
> Please let me know if this causes any further problems.
> 
> <date>  Richard Earnshaw (rearnsha@arm.com)
> 
>         * arm.h (BASE_REG_CLASS): For thumb, don't allow the stack register
>         to be in this class.
> 
>   ---------------------------------------------------------------------------
>                           Name: thumb-base.patch
>    thumb-base.patch       Type: application/x-patch
>                    Description: thumb-base.patch

-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine


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