https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108772
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Richard Biener from comment #5) > another possibility would be to stream "no DIE" info for not late > created decls like by setting DECL_IGNORED_P on them? Like maybe with the following which also fixes the issue: diff --git a/gcc/lto-streamer-in.cc b/gcc/lto-streamer-in.cc index 03cb41cfa16..f91e51b9327 100644 --- a/gcc/lto-streamer-in.cc +++ b/gcc/lto-streamer-in.cc @@ -1739,6 +1739,10 @@ lto_read_tree_1 (class lto_input_block *ib, class data_in *data_in, tree expr) dref_entry e = { expr, str, off }; dref_queue.safe_push (e); } + else if (DECL_P (expr)) + /* Avoid creating a full DIE late for a decl that didn't have + it created early. */ + DECL_IGNORED_P (expr) = 1; } }