https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78835
--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #9) > Created attachment 40524 [details] > gcc7-pr78835.patch > > Untested patch that fixes the ICE on this testcase by marking directly > called functions as needed. Will see what will it do with the size of the > debug info. > Of course, it is not sufficient, with -fdebug-types-section we can still ICE > unless the earlier patch is also applied 9or some more sophisticated one to > construct skeleton DIEs if type inside of type unit is detected). I think this is a reasonable approach (plus the hunk from comment#1 of course). But we can't really create new skeleton DIEs after early-finish because with LTO we do not have access to enough information to build type DIEs.