On Mon, Mar 26, 2012 at 10:17 AM, Eric Botcazou <ebotca...@adacore.com> wrote: >> OTOH if DECL_ALIGN is absolute then if the first field of a record type has >> DECL_ALIGN that is a multiple of BITS_PER_UNIT we know we can use >> the present stor-layout code? So we can check that and give up computing >> representatives at all for a record type if that does not hold. > > I don't think so, DECL_ALIGN of a field is probably honored only if TYPE_ALIGN > of the record is, and TYPE_ALIGN isn't honored for a bit field.
Uh. When is a field a bit field though? At least stor-layout.c resets DECL_BIT_FIELD when local relative alignment is "proper" and the filed has an integer mode. That's overly optimistic if the record is placed at a bit position. Of course we still have DECL_BIT_FIELD_TYPE, but I wonder what the DECL_BIT_FIELD flag is for if we cannot really know whether the field in the end is a "bitfield" anyway... (what value do the various field-decls in a component-ref chain have anyway if the real interpretation is subject to the containing object, which might be even only specified by the type used for an indirect ref ...) Richard. > -- > Eric Botcazou