Re: Make C11 _Alignof return least not greatest alignment for a type (PR c/52023)

2013-12-05 Thread Bin.Cheng
On Thu, Dec 5, 2013 at 6:57 AM, Joseph S. Myers jos...@codesourcery.com wrote: Index: c-family/c-common.c === --- c-family/c-common.c (revision 205668) +++ c-family/c-common.c (working copy) @@ -4921,14 +4921,17 @@

[buildrobot] Re: Make C11 _Alignof return least not greatest alignment for a type (PR c/52023)

2013-12-05 Thread Jan-Benedict Glaw
On Thu, 2013-12-05 17:16:53 +0800, Bin.Cheng amker.ch...@gmail.com wrote: On Thu, Dec 5, 2013 at 6:57 AM, Joseph S. Myers jos...@codesourcery.com wrote: Index: c-family/c-common.c === --- c-family/c-common.c (revision 205668)

Re: Make C11 _Alignof return least not greatest alignment for a type (PR c/52023)

2013-12-05 Thread Andreas Schwab
Joseph S. Myers jos...@codesourcery.com writes: @@ -4994,6 +4997,22 @@ c_sizeof_or_alignof_type (location_t loc, value = size_binop_loc (loc, CEIL_DIV_EXPR, TYPE_SIZE_UNIT (type), size_int (TYPE_PRECISION (char_type_node)

Re: Make C11 _Alignof return least not greatest alignment for a type (PR c/52023)

2013-12-05 Thread Marek Polacek
On Thu, Dec 05, 2013 at 12:22:22PM +0100, Andreas Schwab wrote: Joseph S. Myers jos...@codesourcery.com writes: @@ -4994,6 +4997,22 @@ c_sizeof_or_alignof_type (location_t loc, value = size_binop_loc (loc, CEIL_DIV_EXPR, TYPE_SIZE_UNIT (type), size_int

Re: Make C11 _Alignof return least not greatest alignment for a type (PR c/52023)

2013-12-05 Thread Jakub Jelinek
On Thu, Dec 05, 2013 at 12:43:03PM +0100, Marek Polacek wrote: The following should fix it. 2013-12-05 Marek Polacek pola...@redhat.com c-family/ * c-common.c (c_sizeof_or_alignof_type): Move a declaration into [ADJUST_FIELD_ALIGN]. Ok, thanks. Jakub

Make C11 _Alignof return least not greatest alignment for a type (PR c/52023)

2013-12-04 Thread Joseph S. Myers
As noted in PR 52023, C11 _Alignof should return the *least* alignment required for a type in any context - meaning that on 32-bit x86, _Alignof (double) and _Alignof (long long) should be 4 not 8 because of the reduced alignment inside structures. (C++11 defines alignment requirements