https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83046
--- Comment #12 from Tom de Vries <vries at gcc dot gnu.org> --- Tentative patch: ... diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c index ed3df15b143..de5655abbb6 100644 --- a/gcc/lto-cgraph.c +++ b/gcc/lto-cgraph.c @@ -1111,6 +1111,16 @@ output_offload_tables (void) struct lto_simple_output_block *ob = lto_create_simple_output_block (LTO_section_offload_table); + for (unsigned i = 0; i < vec_safe_length (offload_funcs);) + { + if (!cgraph_node::get((*offload_funcs)[i])) + { + offload_funcs->ordered_remove (i); + continue; + } + i++; + } + for (unsigned i = 0; i < vec_safe_length (offload_funcs); i++) { streamer_write_enum (ob->main_stream, LTO_symtab_tags, ...