This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: C++ PATCH for c++/69763, making C++ alignof match C _Alignof
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches List <gcc-patches at gcc dot gnu dot org>, Jonathan Wakely <jwakely at redhat dot com>, Nathan Sidwell <nathan at acm dot org>
- Date: Tue, 17 Apr 2018 12:50:09 +0000
- Subject: Re: RFC: C++ PATCH for c++/69763, making C++ alignof match C _Alignof
- References: <CADzB+2=1oCCX2MNMtdYAXvfAR-nueujX7tKWGx=7_LSyw8t+mg@mail.gmail.com>
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