This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix 21166


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~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]