Fix 21166

Richard Henderson rth@redhat.com
Tue May 10 17:51:00 GMT 2005


On Tue, May 10, 2005 at 03:27:57PM +0100, Nathan Sidwell wrote:
> +   /* We might be able to clear DECL_PACKED on any members that happen
> +      to be suitably aligned (not forgetting the alignment of the type
> +      itself).  */
> +   for (field = TYPE_FIELDS (rli->t); field; field = TREE_CHAIN (field))
> +     if (TREE_CODE (field) == FIELD_DECL && DECL_PACKED (field)
> + 	&& DECL_OFFSET_ALIGN (field) >= TYPE_ALIGN (TREE_TYPE (field))
> + 	&& TYPE_ALIGN (rli->t) >= TYPE_ALIGN (TREE_TYPE (field)))
> +       DECL_PACKED (field) = 0;

Any reason not to do this in layout_decl where we handle the other
aspects of overalignment?  Seems to me that the known_align argument
can be used just like you want.


r~



More information about the Gcc-patches mailing list