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.