https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67886
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2016-08-25 Ever confirmed|0 |1 --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Dropping polymorphic call info; it can not be used by ipa-prop t99.cc:15:25: note: speculatively devirtualizing call in void test()/7 to virtual void Derived::func()/0 Indirect call -> speculative call void test()/7 => virtual void Derived::func()/0 1 polymorphic calls, 0 devirtualized, 1 speculatively devirtualized, 0 cold 0 have multiple targets, 0 overwritable, 0 already speculated (0 agree, 0 disagree), 0 external, 0 not defined, 0 artificial, 1 infos dropped Confirmed. GCC is also to speculatively devirtualizing. The first time through the loop it is Derived::func but then that is a pure/const function which means it is does not change memory so rest through the loop, it should detect that it can devirtualizing the function call.