This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/67886] Incomplete optimization for virtual function call into freshly constructed object
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 25 Aug 2016 05:50:07 +0000
- Subject: [Bug tree-optimization/67886] Incomplete optimization for virtual function call into freshly constructed object
- Auto-submitted: auto-generated
- References: <bug-67886-4@http.gcc.gnu.org/bugzilla/>
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.