← board

C/i386: return X of an enum constant declared inside an anonymous-struct member returns garbage (00120)

Repro (c-testsuite 00120, whole test)

struct { enum { X } x; } s;
int main() { return X; }   /* i386: exit 96; expected 0 */

Notes

X is enum member 0; returning it yields 96 on i386. Something in the enum-registered-inside-inline-struct path leaves X bound to a non-constant (or the i386 return path reads an uninitialized slot). Check how the C frontend registers enum constants encountered during ParseCStructInto and what the i386 codegen does with that symbol class.

Gate

00120 passes under tools/run_c_conformance.sh --target i386; drop its line from test/c-conformance/pxx.skip.i386.

Log