This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/12306] GOT pointer (r12) reloaded unnecessarily
- From: "olegendo at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 25 Nov 2013 16:22:50 +0000
- Subject: [Bug target/12306] GOT pointer (r12) reloaded unnecessarily
- Auto-submitted: auto-generated
- References: <bug-12306-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12306
--- Comment #6 from Oleg Endo <olegendo at gcc dot gnu.org> ---
Maybe something like function multi-versioning could be used for that?
When compiling as PIC, each function would be output twice. Once with the
assumption that it can be called from non-PIC functions and once with the
assumption that it can't. So we'll have one function that does the r12 stuff
and another that doesn't. Then the linker could figure it out by e.g. dead
code stripping, and maybe also taking into account the visibility. In the
worst case, if the linker can't make a decision, it should leave the
"with-r12-stuff" version.