Options of fixing biggest alignment in PR target/38736
Ian Lance Taylor
iant@google.com
Fri Jan 9 15:59:00 GMT 2009
"Richard Guenther" <richard.guenther@gmail.com> writes:
> On Fri, Jan 9, 2009 at 4:31 PM, Ian Lance Taylor <iant@google.com> wrote:
>> "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.
>
> Sure. The vectorizer increases alignment of variables for this reason.
> But as people cannot adjust their memory allocator behavior they
> cannot use attribute((aligned(max))) for that either. Or do you suggest
> they should stick that on every decl? (which is what the autovectorizer
> does)
People can and do adjust their memory allocator. Doing that in
portable code requires something like attribute((aligned)).
Ian
More information about the Gcc
mailing list