This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: x86_64: Should the -mavx* options affected __alignof__ (max_align_t)?
- From: Florian Weimer <fweimer at redhat dot com>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: GCC <gcc at gcc dot gnu dot org>
- Date: Mon, 23 Mar 2015 19:41:23 +0100
- Subject: Re: x86_64: Should the -mavx* options affected __alignof__ (max_align_t)?
- Authentication-results: sourceware.org; auth=none
- References: <55105B5B dot 50107 at redhat dot com> <alpine dot DEB dot 2 dot 10 dot 1503231831300 dot 14930 at digraph dot polyomino dot org dot uk>
On 03/23/2015 07:34 PM, Joseph Myers wrote:
> On Mon, 23 Mar 2015, Florian Weimer wrote:
>
>> __alignof__ (max_align_t) appears to be stuck at 16, even though some
>> AVX512 operations require 512 byte alignment.
>>
>> Is this intentional? There are arguments for (more ABI compatibility)
>> and against (max_align_t is misleading) this behavior.
>
> max_align_t is only about fundamental alignments. See
> <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1892.htm#dr_445> for an
> accepted cleanup of the alignment wording in C11.
>
> It doesn't seem useful to increase the alignment requirements for malloc
> beyond this, especially as all allocations, even 1-byte ones, have the
> same alignment requirements.
Ah, I should have looked at what max_align_t actually meant. With these
semantics, the name is a bit confusing. I agree that requiring 64 byte
alignment from malloc does not make much sense. Thanks.
--
Florian Weimer / Red Hat Product Security