Issue 91415
Summary [BUG] error: cannot initialize a parameter of type '__attribute__((__vector_size__(2 * sizeof(int)))) int' (vector of 2 'int' values) with an rvalue of type '__v2si' (aka 'int')
Labels new issue
Assignees
Reporter onthegrid007
    Hi I am trying to use clang to compile [https://github.com/luxonis/depthai-core](https://github.com/luxonis/depthai-core) and there is a reoccurring bug in many of the CPP files.

```
[16/28] Building CXX object CMakeFiles/XLink.dir/src/pc/protocols/usb_host.cpp.obj
FAILED: CMakeFiles/XLink.dir/src/pc/protocols/usb_host.cpp.obj 
C:\PROGRA~1\LLVM\bin\CLANG_~1.EXE -DHAVE_STRUCT_TIMESPEC -DUSE_TCP_IP -DUSE_USB_VSC -DWIN32_LEAN_AND_MEAN -DXLINK_ENABLE_LIBUSB -D_CRT_SECURE_NO_WARNINGS -IC:/.hunter/_Base/cb0ea1f/42721b1/7f91c96/Build/XLink/Source/cmake/../src/pc/Win/include -IC:/.hunter/_Base/cb0ea1f/42721b1/7f91c96/Build/XLink/Source/cmake/../src/pc/protocols -IC:/.hunter/_Base/cb0ea1f/42721b1/7f91c96/Build/XLink/Source/cmake/../include/XLink -IC:/.hunter/_Base/cb0ea1f/42721b1/7f91c96/Build/XLink/Source/cmake/../include -isystem C:/.hunter/_Base/cb0ea1f/42721b1/7f91c96/Install/include -O3 -DNDEBUG -D_DLL -D_MT -Xclang --dependent-lib=msvcrt -std=c++14 -MD -MT CMakeFiles/XLink.dir/src/pc/protocols/usb_host.cpp.obj -MF CMakeFiles\XLink.dir\src\pc\protocols\usb_host.cpp.obj.d -o CMakeFiles/XLink.dir/src/pc/protocols/usb_host.cpp.obj -c C:/.hunter/_Base/cb0ea1f/42721b1/7f91c96/Build/XLink/Source/src/pc/protocols/usb_host.cpp
In file included from C:/.hunter/_Base/cb0ea1f/42721b1/7f91c96/Build/XLink/Source/src/pc/protocols/usb_host.cpp:19:
In file included from C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\mutex:15:
In file included from C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\__msvc_chrono.hpp:11:
In file included from C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\limits:15:
In file included from C:\PROGRA~1\LLVM\lib\clang\16\include\intrin.h:20:
In file included from C:\PROGRA~1\LLVM\lib\clang\16\include\x86intrin.h:15:
In file included from C:\PROGRA~1\LLVM\lib\clang\16\include\immintrin.h:21:
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:71:40: error: cannot initialize a parameter of type '__attribute__((__vector_size__(2 * sizeof(int)))) int' (vector of 2 'int' values) with an rvalue of type '__v2si' (aka 'int')
    return __builtin_ia32_vec_ext_v2si((__v2si)__m, 0);
 ^~~~~~~~~~~
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:133:43: error: cannot initialize a parameter of type '__attribute__((__vector_size__(4 * sizeof(short)))) short' (vector of 4 'short' values) with an rvalue of type '__v4hi' (aka 'short')
    return (__m64)__builtin_ia32_packsswb((__v4hi)__m1, (__v4hi)__m2);
 ^~~~~~~~~~~~
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:163:43: error: cannot initialize a parameter of type '__attribute__((__vector_size__(2 * sizeof(int)))) int' (vector of 2 'int' values) with an rvalue of type '__v2si' (aka 'int')
    return (__m64)__builtin_ia32_packssdw((__v2si)__m1, (__v2si)__m2);
 ^~~~~~~~~~~~
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:193:43: error: cannot initialize a parameter of type '__attribute__((__vector_size__(4 * sizeof(short)))) short' (vector of 4 'short' values) with an rvalue of type '__v4hi' (aka 'short')
    return (__m64)__builtin_ia32_packuswb((__v4hi)__m1, (__v4hi)__m2);
 ^~~~~~~~~~~~
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:220:44: error: cannot initialize a parameter of type '__attribute__((__vector_size__(8 * sizeof(char)))) char' (vector of 8 'char' values) with an rvalue of type '__v8qi' (aka 'char')
    return (__m64)__builtin_ia32_punpckhbw((__v8qi)__m1, (__v8qi)__m2);
 ^~~~~~~~~~~~
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:243:44: error: cannot initialize a parameter of type '__attribute__((__vector_size__(4 * sizeof(short)))) short' (vector of 4 'short' values) with an rvalue of type '__v4hi' (aka 'short')
    return (__m64)__builtin_ia32_punpckhwd((__v4hi)__m1, (__v4hi)__m2);
 ^~~~~~~~~~~~
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:264:44: error: cannot initialize a parameter of type '__attribute__((__vector_size__(2 * sizeof(int)))) int' (vector of 2 'int' values) with an rvalue of type '__v2si' (aka 'int')
    return (__m64)__builtin_ia32_punpckhdq((__v2si)__m1, (__v2si)__m2);
 ^~~~~~~~~~~~
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:291:44: error: cannot initialize a parameter of type '__attribute__((__vector_size__(8 * sizeof(char)))) char' (vector of 8 'char' values) with an rvalue of type '__v8qi' (aka 'char')
    return (__m64)__builtin_ia32_punpcklbw((__v8qi)__m1, (__v8qi)__m2);
 ^~~~~~~~~~~~
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:314:44: error: cannot initialize a parameter of type '__attribute__((__vector_size__(4 * sizeof(short)))) short' (vector of 4 'short' values) with an rvalue of type '__v4hi' (aka 'short')
    return (__m64)__builtin_ia32_punpcklwd((__v4hi)__m1, (__v4hi)__m2);
 ^~~~~~~~~~~~
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:335:44: error: cannot initialize a parameter of type '__attribute__((__vector_size__(2 * sizeof(int)))) int' (vector of 2 'int' values) with an rvalue of type '__v2si' (aka 'int')
    return (__m64)__builtin_ia32_punpckldq((__v2si)__m1, (__v2si)__m2);
 ^~~~~~~~~~~~
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:356:40: error: cannot initialize a parameter of type '__attribute__((__vector_size__(8 * sizeof(char)))) char' (vector of 8 'char' values) with an rvalue of type '__v8qi' (aka 'char')
    return (__m64)__builtin_ia32_paddb((__v8qi)__m1, (__v8qi)__m2);
 ^~~~~~~~~~~~
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:377:40: error: cannot initialize a parameter of type '__attribute__((__vector_size__(4 * sizeof(short)))) short' (vector of 4 'short' values) with an rvalue of type '__v4hi' (aka 'short')
    return (__m64)__builtin_ia32_paddw((__v4hi)__m1, (__v4hi)__m2);
 ^~~~~~~~~~~~
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:398:40: error: cannot initialize a parameter of type '__attribute__((__vector_size__(2 * sizeof(int)))) int' (vector of 2 'int' values) with an rvalue of type '__v2si' (aka 'int')
    return (__m64)__builtin_ia32_paddd((__v2si)__m1, (__v2si)__m2);
 ^~~~~~~~~~~~
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:420:41: error: cannot initialize a parameter of type '__attribute__((__vector_size__(8 * sizeof(char)))) char' (vector of 8 'char' values) with an rvalue of type '__v8qi' (aka 'char')
    return (__m64)__builtin_ia32_paddsb((__v8qi)__m1, (__v8qi)__m2);
 ^~~~~~~~~~~~
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:443:41: error: cannot initialize a parameter of type '__attribute__((__vector_size__(4 * sizeof(short)))) short' (vector of 4 'short' values) with an rvalue of type '__v4hi' (aka 'short')
    return (__m64)__builtin_ia32_paddsw((__v4hi)__m1, (__v4hi)__m2);
 ^~~~~~~~~~~~
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:465:42: error: cannot initialize a parameter of type '__attribute__((__vector_size__(8 * sizeof(char)))) char' (vector of 8 'char' values) with an rvalue of type '__v8qi' (aka 'char')
    return (__m64)__builtin_ia32_paddusb((__v8qi)__m1, (__v8qi)__m2);
 ^~~~~~~~~~~~
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:487:42: error: cannot initialize a parameter of type '__attribute__((__vector_size__(4 * sizeof(short)))) short' (vector of 4 'short' values) with an rvalue of type '__v4hi' (aka 'short')
    return (__m64)__builtin_ia32_paddusw((__v4hi)__m1, (__v4hi)__m2);
 ^~~~~~~~~~~~
C:\PROGRA~1\LLVM\lib\clang\16\include\mmintrin.h:508:40: error: cannot initialize a parameter of type '__attribute__((__vector_size__(8 * sizeof(char)))) char' (vector of 8 'char' values) with an rvalue of type '__v8qi' (aka 'char')
    return (__m64)__builtin_ia32_psubb((__v8qi)__m1, (__v8qi)__m2);
 ^~~~~~~~~~~~
C:\PROGRA~1\LLVM
\lib\clang\16\include\mmintrin.h:529:40: error: cannot initialize a parameter of type '__attribute__((__vector_size__(4 * sizeof(short)))) short' (vector of 4 'short' values) with an rvalue of type '__v4hi' (aka 'short')

 return (__m64)__builtin_ia32_psubw((__v4hi)__m1, (__v4hi)__m2);

 ^~~~~~~~~~~~

fatal error: too many errors emitted, stopping now [-ferror-limit=]

20 errors generated.
```

I can't figure out how this is occurring in a header file but I assume its due to a bug with clang, not the library itself... Any help would be appreciated...
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to