http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57084
--- Comment #4 from Martin Jambor <jamborm at gcc dot gnu.org> 2013-05-03 13:45:28 UTC --- (In reply to comment #3) > > @@ -1993,6 +1994,18 @@ ipa_intraprocedural_devirtualization (gi > > token = OBJ_TYPE_REF_TOKEN (otr); > > fndecl = gimple_get_virt_method_for_binfo (tree_low_cst (token, 1), > > binfo); > > + if (!fndecl) > > + return NULL_TREE; > > + > > + callee = cgraph_get_node (fndecl); > > + if (!callee || callee->global.inlined_to) > > + { > > + if (!canonicalize_constructor_val (fndecl, NULL) > fndecl = canonicalize_constructor_val (fndecl, NULL) > Why do you need TREE_PUBLIC check? Well, as I wrote in the comment above, I basically copied the code what you added to ipa_make_edge_direct_to_target in February this year. The comment there says that "In the case of static functions we are out of luck, since we already removed its body." BTW, we also only check canonicalize_constructor_val return value for non-NULL-ness in that function. Anyway, this was just a proof of concept patch. I suppose that we'll want to put this functionality to a separate function and call it from both ipa_make_edge_direct_to_target and eliminate_bb (in tree-ssa-pre.c). I wonder what name to give it to it though, especially given that cgraph_get_create_real_symbol_node already exits (but unlike what is required IIUC cannot return NULL). cgraph_make_fndecl_callable?