https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113633
Bug ID: 113633 Summary: FAIL: gcc.dg/bf-ms-attrib.c execution test, wrong size for ms_struct Product: gcc Version: unknown Status: UNCONFIRMED Keywords: ABI, testsuite-fail Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: nightstrike at gmail dot com CC: ktietz at gcc dot gnu.org Target Milestone: --- Target: *-*-mingw* *-*-cygwin* >From gcc.dg/bf-ms-attrib.c: struct one_ms { int d; unsigned char a; unsigned short b:7; char c; } __attribute__((__ms_struct__)); And later: if (sizeof(struct one_ms) != 8) abort(); Here, we abort, because the size is 12 using the MS ABI. Curiously, the testcase as initially committed used 12, and it was changed to 8 in r0-115284-g4d33b77106cf7f with the description being: gcc.dg/bf-ms-attrib.c: Adjust expected size for ms_struct layout. However, MSVC (and gcc/cygwin FWIW) creates a 12-byte struct, so I am curious which is correct. Should that portion of that commit be reverted, or should the struct be packed into 8 bytes? If you happen to still be reading this, Kai, would you mind weighing in? Perhaps we were incorrectly making 8-byte structs, then changed the testcase to match 8, and later fixed something to generate 12-byte structs?