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]: Fix PR middle-end/6123, cleanup defining __pic__/__PIC__


On Wed, Apr 07, 2004 at 03:03:51AM -0400, Jakub Jelinek wrote:
> ./nptl/sysdeps/pthread/bits/libc-lock.h:#ifdef __PIC__
> ./linuxthreads/sysdeps/pthread/bits/libc-lock.h:# if defined __PIC__ || (defined _LIBC && defined SHARED)
> and these don't pessimize the code when pic, but optimize (without that
> a weak function pointer is loaded from GOT and then going through PLT slot
> if non-NULL, with it it is loaded from GOT and an indirect jump is made
> through it).

Right.  I didn't really analyze the code well enough.  We're not missing
an optimization as I thought, just unnecessarily copying a function
pointer to a temp (which hopefully will be optimized away) in the
non-shared case.  Nevertheless, the test of __PIC__ in these two places
is really about optimizing code for a shared library.

The other place I found __PIC__ in glibc is in ppc64 specific code,
where it does precisely nothing.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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