On Thu, Aug 13, 2020 at 11:44:46AM -0600, Martin Sebor via Gcc-patches wrote: > The underlined code above zeroes out the bytes of elements with > no initializers as well as any padding between fields. It doesn't > consider CONSTRUCTOR_NO_CLEARING. I didn't know about that bit so > I looked it up. According to the internals manual: > > Unrepresented fields will be cleared (zeroed), unless the > CONSTRUCTOR_NO_CLEARING flag is set, in which case their value > becomes undefined.
CONSTRUCTOR_NO_CLEARING shouldn't be relevant to the middle-end (after gimplification). Static variable initializers have zero initialization with or without that bit, and other than that we only allow empty CONSTRUCTORs to mean all zeros or VECTOR CONSTRUCTORs where missing elts are zero initialized too but shouldn't really appear. Jakub