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: RFC: C++ PATCH for c++/69763, making C++ alignof match C _Alignof


On Tue, 10 Apr 2018, Jason Merrill wrote:

> But really this is beside the point: the x86 ABI says that the
> alignment of double is 4, so alignof(double) should be 4 regardless of
> what GCC wants to do internally.  And I think the same is true of
> __alignof__.

__alignof__ needs to stay reflecting the preferred, standalone alignment 
of 8 bytes; changing that is ABI-incompatible; code such as that in 
stddef.h uses __attribute__((__aligned__(__alignof__(long long)))) to give 
structure members the same alignment those types would have for standalone 
objects.  (This doesn't affect the alignment of max_align_t *now* on i386, 
but only because that now includes __float128 as well.)

-- 
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]