https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102024
--- Comment #40 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Uros Bizjak <[email protected]>: https://gcc.gnu.org/g:deb313acd222da2def3517b612b0d59b0fcf6348 commit r17-6987-gdeb313acd222da2def3517b612b0d59b0fcf6348 Author: Uros Bizjak <[email protected]> Date: Tue Dec 1 08:10:24 2026 +0100 i386: Ignore zero-width bit-fields in unions [PR102024] A zero-width bit-field occupies no storage and the psABI classifies it as NO_CLASS. The RECORD_TYPE loop ignores it, but the UNION_TYPE loop classifies it by its declared type, so union { float f; int : 0; } is returned in %eax instead of %xmm0, while the same bit-field in a struct is ignored. Ignore zero-width bit-fields in the UNION_TYPE loop, too. Add PSABI_ZERO_WIDTH_BITFIELD_UNION, so that -Wpsabi informs about the ABI change only for types whose classification actually changes. Assisted-by: Claude Sonnet 5.5 PR target/102024 gcc/ChangeLog: * config/i386/i386.cc (enum psabi_change) <PSABI_ZERO_WIDTH_BITFIELD_UNION>: New. (inform_psabi_change): Handle PSABI_ZERO_WIDTH_BITFIELD_UNION. (classify_argument): Ignore a zero-width bit-field member of a union. gcc/testsuite/ChangeLog: * gcc.target/i386/pr102024-2.c: New test. * gcc.target/i386/pr102024-3.c: Ditto. * g++.target/i386/pr102024-1.C: Ditto.
