https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66196
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- To handle unions specially we'd need to "sort" their fields in some way before doing the comparison (we certainly don't want to do a N^2 compare). We compare field-decl offsets and types which should take care of the memory layout (yes, not alignment but I hardly see where that matters for structural equality). We could also sort union field-decl chains at LTO stream-out (or at layout_type time). Not sure after what we should compare though. We can't use names (cross-language....)