On 05/25/2018 06:27 AM, Peter Maydell wrote:
> We'll currently replace any 'u64' with a 'uint64_t' including when
> it's embedded in an '__aligned_u64', creating a '__aligned_uint64_t'
> which doesn't exist. We need to instead expand out the kernel's
> definition of __aligned_u64:
>    #define __aligned_u64 __u64 __attribute__((aligned(8)))
> before we convert the __u64 to uint64_t.

Wow.  I did not believe that would work.  I expected that you'd need to define
a typedef, or somehow sort the attribute after the identifier to which it 
applies.

However

typedef unsigned long uint64_t;
uint64_t __attribute__((aligned(16))) a;
struct bar { uint64_t __attribute__((aligned(16))) foo; } b;

produces the expected alignments with both gcc(8) and clang(6).

Reviewed-by: Richard Henderson <richard.hender...@linaro.org>


r~

Reply via email to