This is the mail archive of the
mailing list for the GCC project.
Re: x86_64: Should the -mavx* options affected __alignof__ (max_align_t)?
- From: Michael Matz <matz at suse dot de>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Florian Weimer <fweimer at redhat dot com>, Joseph Myers <joseph at codesourcery dot com>, "H.J. Lu" <hjl dot tools at gmail dot com>, Andrew Haley <aph at redhat dot com>, GCC <gcc at gcc dot gnu dot org>
- Date: Thu, 2 Apr 2015 15:52:25 +0200 (CEST)
- 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> <55105E53 dot 8020002 at redhat dot com> <551CFD38 dot 9040200 at redhat dot com> <551D0060 dot 1020805 at redhat dot com> <551D01E5 dot 9070405 at redhat dot com> <CAMe9rOoxjp1TFUgg493r_1LT9S9ZH=1D-+riO3f32A_WqcYN3A at mail dot gmail dot com> <551D2319 dot 4010905 at redhat dot com> <alpine dot DEB dot 2 dot 10 dot 1504021132050 dot 32247 at digraph dot polyomino dot org dot uk> <551D2B60 dot 4030807 at redhat dot com> <20150402115142 dot GR19273 at tucnak dot redhat dot com>
On Thu, 2 Apr 2015, Jakub Jelinek wrote:
> > But it is dubious to require that, say, strdup ("example") returns a
> > pointer which is 16-byte-aligned, too.
> > What is missing, it seems to me, is the qualification that for the
> > pointer returned by malloc, the alignment requirements only of those
> > types whose size does not exceed the malloc argument argument need to
> > be considered.
> Why? The standard requires that it is aligned even for the smaller
> sizes, and glibc malloc honors that. Why do you want to change it all
> of sudden?
Because it would increase waste even more when going from align-8
to align-16 even for allocations for less than 8 byte.