http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59176
Martin Jambor <jamborm at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jamborm at gcc dot gnu.org Assignee|mjambor at suse dot cz |unassigned at gcc dot gnu.org --- Comment #9 from Martin Jambor <jamborm at gcc dot gnu.org> --- (In reply to Jan Hubicka from comment #8) > > I believe it is bug somewhere in logic skipping thunks. Martin, this is > probably yours. I on the other hand think this is either a verification false positive or some sort of cgraph node removal bug. What happens in IPA-CP is this: m_fn3/8 originally calls B::~B()/5 which is an alias (not a thunk as far as I can see but I do not see how that matters even if I was wrong) to B::~B()/4. IPA-CP does not gather constants for aliases or thunks separately (though it is careful not to propagate first parameters through thunks), so IPA-CP is only interested in the /4 real thing. Furthermore, it decides to clone B::~B()/4 and redirect the call from m_fn3/8 to the new clone. In fact, the modified edge passes verify_edge_corresponds_to_fndecl just fine several times because of !clone_of_p (cgraph_function_or_thunk_node (node, NULL), e->callee)) part of the checking correctly detects this case. But then, after being successfully verified a number of times, the above fails, because the cgraph_function_or_thunk_node (node, NULL) part stops returning the /4 node but returns the argument itself which is /5. When I now dump the node I cannot see it being an alias and that is because symtab_remove_unreachable_nodes had zapped it. I think that either symtab_remove_unreachable_nodes should remove nodes it cripples from the decl->symtab hash (why does it not call cgraph_remove_node?) or the verifier needs to understand that these nodes are no good and ignore them.