http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51680
--- Comment #11 from Jan Hubicka <hubicka at gcc dot gnu.org> 2012-01-07 16:11:50 UTC --- Well, the problem here is that we compile with -O2 and function is not declared inline. Conequetely GCC inlines only when it thinks code size will shrink. Inliner always works one step at a time and it does not know that inlining process_fun_at is important to inline to inline add. We now have estimate_edge_devirt_benefit that I fixed last week to also notice indirect calls like this one. Unfortunately it is still not enough, since inliner won't get past the idea that replacing a call by two calls is increasing code size. For 4.8 I plan to include logic that allows to bypass the limits when inlining is known to be profitable, but I don't see much to do in 4.7 timeframe. 4.6 early inlined it more due to accounting bug. Honza