This is the mail archive of the gcc@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: Options of fixing biggest alignment in PR target/38736


"Richard Guenther" <richard.guenther@gmail.com> writes:

>> There are many ways to align data without exposing it in the
>> ABI--e.g., the alignment of a global array is not part of the ABI, in
>> that nothing breaks if the alignment is increased.  Also, there are
>> many programs which simply don't care about an external ABI.
>
> I'd say if programs want to use vectorization they should use
> alignof (vector_type) instead of a magic attribute((aligned(max))).

It's not that programs explicitly want to use vectorization.  It's
that auto-vectorization happens on ordinary scalar types, and programs
want to permit that to happen without worrying about the details.

(I've had my code crash because gcc autovectorized it but the x86
malloc did not return the alignment which gcc expected.  This happened
without any vector types being involved at all.  Not that that proves
anything one way or another about attribute ((aligned)).)

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]