[m68k] PIC fixes

Paul Brook paul@codesourcery.com
Tue Dec 20 22:31:00 GMT 2005


On Tuesday 20 December 2005 22:01, Aaron J. Grier wrote:
> On Tue, Dec 20, 2005 at 09:43:14PM +0000, Paul Brook wrote:
> > This is a followup for a patch originally posted by Dan some time ago,
> > with the two changes requested by Bernardo.
> >
> > http://gcc.gnu.org/ml/gcc-patches/2005-04/msg01281.html
> >
> > This is a regression where gcc tries to generate bsr.l for pic code on
> > targets that don't support bsr.l.
> >
> > There was some discussion about whether -fpic should use bsr.w. IIUC
> > the conclusion was that even though text/data are <64k, the GOT may
> > still be a long way from .text. If people want a really-small model it
> > should be implemented as a separate option.
>
> according to my reference manual, 68030 and 68040 can also do 32bit
> displacements, so checking only TARGET_68020 is not sufficient.

TARGET_68020 is true for all 680x0 cores where x > 2.

> if USE_GAS is enabled, could jbsr be generated, and let gas figure out
> if the displacement will fit into a word or byte?

IIUC jbsr turns an out of range relative branch into an absolute jump. We're 
generating PIC code, so this isn't an option.

Paul



More information about the Gcc-patches mailing list