http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47462
Summary: g++.dg/opt/devirt1.C no longer devirtualized Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassig...@gcc.gnu.org ReportedBy: jamb...@gcc.gnu.org Since the fix for PR 47382: http://gcc.gnu.org/ml/gcc-patches/2011-01/msg01753.html the test case g++.dg/opt/devirt1.C had to be XFAILed for reasons explained in the email with the patch. Basically, whenever we want to fold OBJ_TYPE_REF to a direct call according to the type of its 1st argument, we need to check for dynamic type changes. Patches http://gcc.gnu.org/ml/gcc-patches/2010-12/msg01218.html and http://gcc.gnu.org/ml/gcc-patches/2010-12/msg01214.html do this but suffer from another problem because currently we also must make sure we do not create a call to a thunk which cannot be represented in the call graph (or compensate for in the caller). The patches do detect thunks by looking at call graph nodes but we do not have a call graph node for the destination and so the code bails out.