This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/56446] [4.6/4.7/4.8 Regression] Generate one fewer relocation when calling a checked weakref function
- 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 Feb 2013 10:26:11 +0000
- Subject: [Bug tree-optimization/56446] [4.6/4.7/4.8 Regression] Generate one fewer relocation when calling a checked weakref function
- Auto-submitted: auto-generated
- References: <bug-56446-4@http.gcc.gnu.org/bugzilla/>
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.