noalias attribute in LLVM/clang 3.9?

I see in the docs that there is supposed to be a noalias attribute in LLVM 3.9 ( http://llvm.org/releases/3.9.0/tools/clang/docs/AttributeReference.html#noalias), however, when I try to use it I get an error. Part of the source:


typedef double InArray[DIM][DIM];

//void f1( InArray, const InArray, const InArray) __attribute((noalias));
void f1( InArray c, const InArray a, const InArray b ) attribute((noalias))
{

When I compile with clang, I get:

ma.c:17:72: warning: unknown attribute ‘noalias’ ignored [-Wunknown-attributes]
void f1( InArray c, const InArray a, const InArray b ) attribute((noalias))

Just to make sure I’m running 3.9:

$ clang --version
clang version 3.9.0 (tags/RELEASE_390/final)

What’s happening here?

Phil

Hi Phil,

I’m not familiar with the attribute, but the documentation you linked to indicates it’s only available with the __declspec syntax, not attribute.

That is:
__declspec(noalias) void f1( InArray c, const InArray a, const InArray b ) {…

Also, questions related to clang - as opposed to LLVM internals - will probably get higher-quality answers on cfe-dev, not llvm-dev.

(bcc: llvm-dev, cc: cfe-dev)

Thanks,
Michael

Yes.

Grepping around, it seems like you need -fms-compatibility to use it.

vedant

Thanks, Vedant. That worked.

Phil