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] Avoid one unnecessary PLT slot in every GCC created shared library


On Thu, Jan 15, 2004 at 04:38:23PM -0500, Jakub Jelinek wrote:
> For weak function it is not an optimization IMHO.

Probably, but the optimizer doesn't check for that.

> But I was surprised that
> int baz (void)
> {
>   extern void foo (void);
>   void (*pfoo) (void) = foo;
>   pfoo ();
>   return 0;
> }
> leaves with -O2 -fpic on IA32:
> ...
> call    *foo@GOT(%ebx)

File a bug report please.  I remember working to make sure this was
possible on Alpha.  In particular, this optimization is very handy
for cleaning up after inlining.

> Or should I add __asm ("" : "+r" (register_classes));
> to make sure it is really never converted back into PLT call?

Probably would be best.


r~


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