https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67372
Bug ID: 67372 Summary: Functions created via cp/decl2.c:start_objects not properly registered Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: rguenth at gcc dot gnu.org CC: hubicka at gcc dot gnu.org, jason at gcc dot gnu.org Target Milestone: --- Those never go through cgraph::finalize_function or rest_of_decl_compilation. Eventually they get created a cgraph node for via c-genericize here: /* Dump all nested functions now. */ cgn = cgraph_node::get_create (fndecl); for (cgn = cgn->nested; cgn ; cgn = cgn->next_nested) c_genericize (cgn->decl); this causes us to not generate any early debug for those functions (which might be desired but then those decls should be DECL_IGNORED_P, not just DECL_ARTIFICIAL - there is some ObjC use I don't grok and VTV use). Removing the above get_create will create the cgraph node from decl_init_priority_insert (in the VTV case) which happens via lang_hooks.decls.post_compilation_parsing_cleanups which happens _after_ finalizing the CU. This is from debugging an ICE (missed early debug DIE) with LTO early debug and g++.dg/ubsan/pr59437.C STH is rotten here regarding to symtab correctness I think. Not sure what debug info we want for DECL_ARTIFICIAL functions that do not have an (non-artificial) abstract origin but are not DECL_IGNORED_P.