Error: Cannot use vector unsigned long long[2] to initialize vector unsigned long long[2]

对着背影说爱祢 提交于 2019-12-25 03:58:29

问题


We are testing under Sun Studio 12.3. We are catching a compiler error that's not present under 12.4 and later. Its not present under 12.1 and earlier, but that's because the compiler has trouble with AES instructions. Its also not present under other compilers, like Clang, GCC, ICPC and VC++. The error is:

/opt/solarisstudio12.3/bin/CC -DDEBUG -g3 -xO0 -D__SSE2__ -D__SSE3__ -D__SSSE3__ \
-D__SSE4_1__ -D__SSE4_2__ -D__AES__ -D__PCLMUL__ -D__RDRND__ -D__RDSEED__ -D__AVX__ \
-D__AVX2__ -D__BMI__ -D__BMI2__  -native -m64 -KPIC -template=no%extdef -c rijndael.cpp

"/opt/solarisstudio12.3/prod/include/CC/Cstd/algorithm", line 283: Error: Cannot use vector unsigned long long[2] to initialize vector unsigned long long[2].
"rijndael.cpp", line 277:     Where: While instantiating "std::swap<vector unsigned long long[2]>(unsigned long long(&)[2], unsigned long long(&)[2])".
"rijndael.cpp", line 277:     Where: Instantiated from non-template code.
1 Error(s) detected.
gmake: *** [rijndael.o] Error 2
gmake: *** Waiting for unfinished jobs....
ERROR: failed to make cryptest.exe

The code in question is:

std::swap(*(__m128i*)(rk), *(__m128i*)(rk+4*m_rounds));

I have a couple of questions:

  • What is the compiler having trouble with?
  • What is the best way to clear the error?

I have to ask the second question because I'm not sure of SunCC and the __m128i type given I could use raw memcpy, try to write my own swap, or even try an iter_swap without the dereference.

来源:https://stackoverflow.com/questions/38417190/error-cannot-use-vector-unsigned-long-long2-to-initialize-vector-unsigned-lon

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!