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: m68k PIC fixes


Bernardo Innocenti <bernie@develer.com> writes:

> Richard Henderson wrote:
>> On Tue, Apr 12, 2005 at 10:53:47AM -0400, Daniel Jacobowitz wrote:
>> 
>>>-  else if ((flag_pic == 1) || TARGET_68020)
>>>+  else if (TARGET_68020)
>>> #if defined(USE_GAS)
>>>     out = "bsr.l %0@PLTPC";
>> 
>> I wonder if the intent with -fpic was to use the 16-bit offset?
>
> Actually, we'd better split it like this:
>
>   else if (flag_pic == 1)
>     out = "bsr.w %0@PLTPC";
>   else if (TARGET_68020)
>     out = "bsr.l %0@PLTPC";

The two branches need to be swapped.  Just because the GOT is smaller than
32K does not mean that the PLT is less then 32k away.  So you always have
to use bsr.l even with -fpic.

> Today, -fpic has lost much of its applicability outside
> tiny embedded systems.

There are very few libraries that actually need more than 32k of GOT, and
the use of 16 bit instead of 32 bit GOT offsets is reducing code size
quite a bit.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


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