https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120326
--- Comment #3 from uecker at gcc dot gnu.org --- Those should not get the same TYPE_CANONICAL. tagged_types_tu_compatible_p should be changed to detect this case which is due to different packing of bit fields. It works correctly for this: struct { unsigned char a; unsigned char b; unsigned long c; } a; struct { unsigned char a; unsigned char b; unsigned long c; } __attribute__((packed)) b;