Re: [PATCH] [gdb/testsuite] Fix gdb.arch/i386-avx.exp with clang

Pedro Alves
2021-11-05T12:25:55Z

On 2021-11-05 11:54, Andrew Burgess via Gdb-patches wrote:
> * Tom de Vries via Gdb-patches <gdb-patches@sourceware.org> [2021-11-05 10:43:38 +0100]:

>>> I see the same problem. Did you consider using:
>>>
>>> /* Some useful comment .... */
>>> v8sf_t data[] __attribute__ ((aligned(32))) = ....
>>>
>>> this seems to fix the problem on clang for me, and still works fine
>>> with gcc.
>>
>> I did consider this, and decided against it because it's not
>> portable.
>>
>> Note btw that there is no other usage of this:
>> ...
>> $ find gdb/testsuite/ -type f | xargs grep attribute.*align
>> $
>
> No, but in gdb/testsuite/lib/attribute.h we do setup a compatibility
> macro for 'noclone', so there's definitely precedent for using
> attributes that might not be supported everywhere.
>
> I'd hope most production level compilers would, if they don't support
> 'aligned' have something similar/equivalent.
>
> Personally, I'd go with a compatibility macro, and let folk who care
> about other compilers figure out what they need when they hit the
> problem.

I agree, and I'm not aware of any serious production compiler that doesn't
support some way of forcing alignment.

Pedro Alves

> But I'm not blocking your proposed solution if you feel
> strongly about it.