http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51929
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-02-10 10:33:33 UTC --- This is related to same body aliases. The verification fails because IPA-CP decides to cgraph_redirect_edge_callee a call_stmt that calls a same_body_alias of B<char>::B(A, int) (__comp_ctor) to a clone of not that node (i.e. not the same_body_alias), but of its ->thunk.alias (i.e. the alias with the actual body of the ctor, __base_ctor). I don't find anything wrong on that, so I've tried to adjust just the verification: - function. This ping-pong has to go, eventaully. */ + function. This ping-pong has to go, eventually. */ && (node != cgraph_function_or_thunk_node (e->callee, NULL)) - && !clone_of_p (node, e->callee)) + && !clone_of_p (node, e->callee) + /* If decl is a same body alias of some other decl, allow e->callee to be + a clone of a clone of that other decl too. */ + && (!node->same_body_alias + || !clone_of_p (cgraph_get_node (node->thunk.alias), e->callee))) but unfortunately it just cures one of the two error: edge points to wrong declaration: errors.