This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix up _Alignof with user aligned types (PR c/63495)
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 10 Oct 2014 16:02:25 +0000
- Subject: Re: [PATCH] Fix up _Alignof with user aligned types (PR c/63495)
- Authentication-results: sourceware.org; auth=none
- References: <20141010104615 dot GG10376 at tucnak dot redhat dot com>
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