https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95418
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #4) > Looks like: > unsigned short int __cs_selector; > - unsigned short int __opcode; > + unsigned int __opcode:11; > + unsigned int __unused4:5; > > For Windows ABI, the int causes the bitfield to start at the next 4byte > alignment. Unlike Linux ABI. > I suspect using unsigned short will fix the issue. NOTE clang might not > implement the correct Windows ABI. The Visual Windows ABI does say the following: a bit-field won't share the same storage unit with the previous bit-field if their underlying types have different sizes, and the bit-field will be aligned to the highest alignment of the underlying types of itself and of the previous bit-field --- CUT --- So this is why the difference between Linux and Windows ABI comes into place. So I suspect Clang is wrong.