On Sun, 17 Dec 2023, Martin Uecker wrote: > + tree f = build_decl (input_location, FIELD_DECL, DECL_NAME (a), > + composite_type_internal (ta, tb, cache)); > + > + DECL_PACKED (f) = DECL_PACKED (a); > + SET_DECL_ALIGN (f, DECL_ALIGN (a)); > + DECL_ATTRIBUTES (f) = DECL_ATTRIBUTES (a);
grokdeclarator, as called for the original declarations of fields, also has logic to set DECL_NONADDRESSABLE_P (for bit-fields), DECL_PADDING_P (for unnamed bit-fields) and C_DECL_VARIABLE_SIZE. I don't see anything that would cause these to be set appropriately for a composite type. (The first two are only used in the middle-end, which might make it harder to test that they have the right values.) -- Joseph S. Myers jos...@codesourcery.com