https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89933
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 46145 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46145&action=edit gcc9-pr89933.patch Untested fix. The code added in r234626 aka PR70297 fix assumes that the type is not its main variant, which is the case here. If we wanted to remove the main variant from its variant list, we'd need to adjust all the variants in the list (if any) to some other main variant. I'd think just changing the TYPE_NAME is better in this case, usually there won't be any variants in that case and the remove type won't be referenced from anywhere, but if it is, we won't ICE because it refers to ggc_freed TYPE_DECL.