[PATCH] align_value attribute in Clang

Hal Finkel hfinkel at anl.gov
Thu Sep 25 17:28:23 PDT 2014


----- Original Message -----
> From: "Richard Smith" <richard at metafoo.co.uk>
> To: hfinkel at anl.gov, "aaron ballman" <aaron.ballman at gmail.com>, bigcheesegs at gmail.com, richard at metafoo.co.uk, "a
> bataev" <a.bataev at hotmail.com>
> Cc: cfe-commits at cs.uiuc.edu
> Sent: Thursday, September 25, 2014 7:06:33 PM
> Subject: Re: [PATCH] align_value attribute in Clang
> 
> I'd like some more information about how ICC treats this attribute.
> Does it produce a new type? For instance:

I did a quick experiment with icc (ICC) 14.0.1 20131008 (with -Wall -O3 -pedantic):

> 
>   typedef int *I32 __attribute__((align_value(32)));
>   typedef int *I64 __attribute__((align_value(64)));
> 
>   typedef I32 X; typedef I64 X; // ill-formed?

No diagnostic.

>   template<typename> struct Y;
>   typedef Y<I32> Z; typedef Y<I64> Z; // ill-formed?

No diagnostic.

> 
>   extern I32 i32;
>   I64 i64 = i32; // ill-formed? Is an explicit cast required?

No diagnostic.

>   I32 i32 = i64; // ill-formed? Is there an implicit conversion that
>   discards alignment?

No diagnostic.

Alexey, can you please comment on the specifics?

 -Hal

> 
> ... and if there's an implicit conversion that discards alignment,
> what is its conversion rank?
> 
> If I have:
> 
>   int n __attribute__((aligned(32)));
> 
> ... then what is `decltype(&n)`? Is it `int*`, or `int*
> __attribute__((align_value(32)))`?
> 
> http://reviews.llvm.org/D4635
> 
> 
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory



More information about the cfe-commits mailing list