Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
7568 Discussions

expression must have pointer-to-object type

Shahzad_Malik_MUZAFF
375 Views

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 foo.cc
Y/src/foo.cc(2): error: expression must have pointer-to-object type
  float x(Vec4F const & v){return  v[0];}
                                   ^

compilation aborted for foo.cc (code 2)
0 Kudos
1 Reply
Georg_Z_Intel
Employee
375 Views

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?
https://software.intel.com/en-us/node/524399

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

Best regards,

Georg Zitzlsberger

Reply