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: [PATCH] Fix up _Alignof with user aligned types (PR c/63495)


On Fri, 10 Oct 2014, Jakub Jelinek wrote:

> Hi!
> 
> As the testcase shows, _Alignof can sometimes return smaller number
> than the minimum alignment.  That is because when laying out structures,
> fields with types with TYPE_USER_ALIGN set have also DECL_USER_ALIGN
> set and therefore neither BIGGEST_FIELD_ALIGNMENT nor ADJUST_FIELD_ALIGN
> is applied to them, but min_align_of_type was applying that unconditionally.
> 
> Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for
> trunk/4.9?
> 
> 2014-10-10  Jakub Jelinek  <jakub@redhat.com>
> 
> 	PR c/63495
> 	* stor-layout.c (min_align_of_type): Don't decrease alignment
> 	through BIGGEST_FIELD_ALIGNMENT or ADJUST_FIELD_ALIGN if
> 	TYPE_USER_ALIGN is set.
> 
> 	* gcc.target/i386/pr63495.c: New test.

OK.

-- 
Joseph S. Myers
joseph@codesourcery.com


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