https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89692
--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #8) > Can't we change that way e.g. TYPE_CANONICAL of some type? The types are unused, otherwise they'd be visited by fld. > I would feel much safer if we do this TYPE_NEXT_VARIANT adjustment with > turning > those types left out into distinct type if we'd fld_worklist_push > (TYPE_CANONICAL (type), fld); and so there would be at least sanity in what > say > later build_qualified_type creates etc. not sure what you are refering to. All type-reuse keys on TYPE_MAIN_VARIANT in the end and iff a such freed type is picked up later then FLD misses some important use chain. The only one that might still come along the type is the garbage collector and I was worried it might go off into cycles if we leave TYPE_NEXT/MAIN_VARIANT unchanged but change the TYPE_MAIN_VARIANT varaint chain.