https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66668
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 37417 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37417&action=edit gcc6-pr66668.patch Untested fix. Though, I wonder if mod_type_die already has some parent it wouldn't be better to stick the qualified DIEs for it always under the same parent, rather than to whatever other mod_scope is current at the time when creating the DIEs.