https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71159
Jan Hubicka <hubicka at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hubicka at gcc dot gnu.org --- Comment #2 from Jan Hubicka <hubicka at gcc dot gnu.org> --- Does this help? Index: lto-cgraph.c =================================================================== --- lto-cgraph.c (revision 236275) +++ lto-cgraph.c (working copy) @@ -259,7 +259,7 @@ lto_output_edge (struct lto_simple_outpu streamer_write_gcov_count_stream (ob->main_stream, edge->count); bp = bitpack_create (ob->main_stream); - uid = (!gimple_has_body_p (edge->caller->decl) + uid = (!gimple_has_body_p (edge->caller->decl) && !edge->caller->thunk.thunk_p ? edge->lto_stmt_uid : gimple_uid (edge->call_stmt) + 1); bp_pack_enum (&bp, cgraph_inline_failed_t, CIF_N_REASONS, edge->inline_failed); I suppose when we inline thunk but also inline into thunk we may end up having wrong lookup for stmt uid here.