https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78835
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Now, even going through all cgraph edges and marking the callee DIEs as used (setting die_mark for them) early (but I guess it would be better to do the early finish then after early optimizations, but before free_lang_data) would help in this particular case, but not when we only need devirtualization or later optimizations to turn indirect calls into direct calls. Creating a skeleton DIE tree in resolve_addr is yet another option, but I'm not very familiar with the break_out_comdat_types details (generate_skeleton and the like) to know how difficult it would be exactly. Though, for LTO we'll need to figure out anyway where to create those.