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

[Bug middle-end/56727] Recursive call goes through the PLT unnecessarily


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56727

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-03-26 17:05:12 UTC ---
Note it would need to be done with lots of care, because you can e.g. have
aliases to the function and in that case you should go through the PLT:
__attribute__((noinline, noclone))
void f(short b)                                                                 
{                                                                               
  f(0);                                                                         
}                                                                               
static void g (short) __attribute__ ((alias ("f")));
void
h ()
{
  g (0);
}

Because the global scope f can be in different shared library, but if you call
h () and is defined only in this CU, you call this CU's f, no the globally
visible one.


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