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: RFA (stor-layout): PATCH for c++/65734 (attribute aligned and templates)


On Tue, Apr 14, 2015 at 12:06:16PM -0400, Jason Merrill wrote:
> With C++ templates and attribute ((aligned)), you can have TYPE_ALIGN and
> TYPE_USER_ALIGN set on a type before you know its size, so layout_type and
> kin need to respect them if they are already set.
> 
> Tested x86_64-pc-linux-gnu.  OK for trunk?

Wonder what will happen if finalize_type_size or fixup_attribute_variants
is called on a type variant with TYPE_USER_ALIGN before it is called
on the TYPE_MAIN_VARIANT; I'd guess that in that case all the variants
including the main variant would be marked as TYPE_USER_ALIGN and might have
incorrect TYPE_ALIGN.  Perhaps they shouldn't propagate anything to other
variants if user_align is set, or recurse (at least finalize_type_size)
on the TYPE_MAIN_VARIANT if it is called on some other variant, as a way to
propagate the layout to other variants?

Otherwise the patch LGTM.

	Jakub


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