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 target/12306] GOT pointer (r12) reloaded unnecessarily


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.


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