This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/56727] Recursive call goes through the PLT unnecessarily
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 26 Mar 2013 17:05:12 +0000
- Subject: [Bug middle-end/56727] Recursive call goes through the PLT unnecessarily
- Auto-submitted: auto-generated
- References: <bug-56727-4 at http dot gcc dot gnu dot org/bugzilla/>
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.