Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7873 Discussions

expression must have pointer-to-object type


Following compiles with gcc but fails with Intel compiler, any idea?

typedef float __attribute__ ( ( vector_size( 4*sizeof(float) ) ) ) Vec4F;
float x(Vec4F const & v){return  v[0];}
>icpc -v
icpc version 15.0.0 (gcc version 4.8.1 compatibility)
>icpc -c
Y/src/ error: expression must have pointer-to-object type
  float x(Vec4F const & v){return  v[0];}

compilation aborted for (code 2)
0 Kudos
1 Reply

Hello Shahzad,

we've a feature request currently pending for __attribute__ ((vector_size(...))). Right now it's not supported by the Intel(R) C++ Compiler. The ticket is DPD200173341 DPD200526864 and I'll tell our engineers once more about the importance of this.

For the CMS code, I've already created a workaround, which I'm not very keen to propose (but could share with you). It simply wraps the vector to a class and overloads various operators. It's very invasive and not my favorite choice.

Maybe you could use the SIMD intrinsics class as a more appropriate workaround?

As soon as the feature request is implemented I'll update the thread.

Best regards,

Georg Zitzlsberger

0 Kudos