https://gcc.gnu.org/bugzilla/show_bug.cgi?id=45791
Martin Jambor <jamborm at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|NEW |RESOLVED --- Comment #18 from Martin Jambor <jamborm at gcc dot gnu.org> --- The release_ssa dump of function main in the testcase from bug description is just "return 0;" The release_ssa dump of function main the testcase from comment #15 is: int main () { <bb 2> [local count: 1073741824]: Sub::bar (&foo); Sub::bar (&foo); return 0; } ...so devirtualized in my book (main is cold, so they are not inlined, of course). The release_ssa dump of function foo in the testcase from comment #5 is: void foo () { void * _3; <bb 2> [local count: 1073741824]: _3 = operator new (8); MEM[(struct X *)_3]._vptr.X = &MEM <int (*) ()[4]> [(void *)&_ZTV1X + 16B]; X::~X (_3); return; } ...so also devirtualzied before IPA. Therefore I am going to close this old bug as done. If anyone finds a different testcase where the early optimizers should do a better job to help devirtualziation, please file a new bug.