http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55498
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2012-12-13 Ever Confirmed|0 |1 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> 2012-12-13 11:41:28 UTC --- Confirmed. It needs -O3 (or -fipa-cp-clone) to actually get to the point to devirtualize all indirect calls (thus inline print and one/twoStrategy). Jump functions: Jump functions of caller printf: Jump functions of caller main: callsite main/8 -> print/7 : param 0: CONST: twoStrategy callsite main/8 -> print/7 : param 0: CONST: oneStrategy good! Propagating constants: Not considering main for cloning; no hot calls. Not considering twoStrategy for cloning; no hot calls. Not considering two for cloning; no hot calls. Not considering oneStrategy for cloning; no hot calls. Not considering one for cloning; no hot calls. so it cloned print(), good! print.constprop.1/11 (print.constprop.1) @0x7f2c26dfa940 Type: function Visibility: References: twoStrategy/6 (addr) Referring: Clone of print/7 Availability: local Function flags: analyzed local finalized Called by: main/8 (3.00 per call) Calls: twoStrategy/6 (1.00 per call) twoStrategy/6 (1.00 per call) printf/9 (1.00 per call) printf/9 (1.00 per call) Has 2 outgoing edges for indirect calls. But the issue is that there are no return functions and thus we cannot discover the direct call for fn = indirect (); fn (); at IPA time even when indirect () returns just a constant. We need iteration for this at the moment. Or better, IPA-CP needs return functions implemented.