Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Hugh_D_
Beginner
104 Views

[Bug report] ICC internal error when trying to assign a subword of an __m128 in an array directly

The following code provokes a compiler internal error with ICC 16.0.1 on Ubuntu 14.04, while GCC 4.8 compiles it without any problem :

#include <immintrin.h>

int main(void) {
  __m128 v[2];
  v[0][0] = 1.0f;
  return 0;
}

The error output is:

$ icc test.c
": internal error: ** The compiler has encountered an unexpected problem.
** Segmentation violation signal raised. **
Access violation or stack overflow. Please contact Intel Support for assistance.

compilation aborted for test.c (code 4)

Now replacing the line

  v[0][0] = 1.0f;

by

  v[0] =  _mm_set_ss(1.0f);

ICC compiles the source fine.

Perhaps I should not assign a subword like this, since I rely on the implementation, but I guess that nobody would expect the compiler to crash like this.

0 Kudos
4 Replies
Anoop_M_Intel
Employee
104 Views

I agree that the compiler should not crash with a segfault in such case. I have escalated this issue to compiler engineering. 

Thanks and Regards
Anoop

jimdempseyatthecove
Black Belt
104 Views

v[0].m128_f32[0] = 1.0f;

Jim Dempsey

Hugh_D_
Beginner
104 Views

jimdempseyatthecove wrote:

v[0].m128_f32[0] = 1.0f;

Jim Dempsey

Thanks, but this is less portable than using _mm_set_[sp]s.
It will probably not compile with GCC and may not compile with ICC, because the type _m128 has several possible definitions, depending on predefined macros (see Intel's immintrin.h header)

Anoop_M_Intel
Employee
104 Views

This issue is fixed in 17.0 compiler which is available at Intel Registration Center.

Thanks and Regards
Anoop

Reply