[Bug tree-optimization/56446] [4.6/4.7/4.8 Regression] Generate one fewer relocation when calling a checked weakref function
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Feb 26 10:26:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56446
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-02-26 10:26:11 UTC ---
Well, if you know the call will got through PLT, on many targets the PLT
contains indirect call anyway, but you generally don't know that.
foo might be hidden and defined in the same shared library or executable, at
which point this change would be code penalization rather than improvement.
Anyway, I agree with Richard here, we shouldn't avoid the propagation, but if
it is desirable on some target (but see above, I think it is really hard to
figure out whether it is desirable or not from the compiler), then it should be
done later in the RTL, because otherwise we might prevent important
optimizations.
If you know as a programmer that it is beneficial in your case, you can always
add asm ("" : "+r" (ptr)); after the int (*ptr)() = f; line.
More information about the Gcc-bugs
mailing list