Issue 238742
Summary __builtin_shufflevector clang++ crash/SIGSEGV
Labels clang
Assignees
Reporter zngos
    --- m.cppm
```
export module m;
export template <int N> int f() {
  typedef int v4 __attribute__((vector_size(16)));
  v4 a{};
  return __builtin_shufflevector(a, a, 1, 0, 3, 2)[0];
}
```

--- use.cpp
```
import m;
int main() { return f<0>(); }
```

```
clang++ -std=c++20 --precompile m.cppm -o m.pcm
clang++ -std=c++20 -fmodule-file=m=m.pcm -fsyntax-only use.cpp   # crashes
```

```
Stack dump:
0.	Program arguments: third_party/toolchain/clang++ -std=c++20 -fmodule-file=m=/tmp/m.pcm -fsyntax-only /tmp/use.cpp
1.	<eof> parser at end of file
2.	/tmp/m.cppm:2:29: instantiating function definition 'f<0>'
clang++: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 23.1.5
Target: x86_64-alpine-linux-musl
Thread model: posix
InstalledDir: ---------
clang++: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING CRASH REPRODUCER FILES TO THE BUG REPORT:
clang++: note: diagnostic msg: /tmp/use-56bea6.cpp
clang++: note: diagnostic msg: /tmp/use-56bea6.sh
clang++: note: diagnostic msg: 

********************
```

[use-56bea6.sh](https://github.com/user-attachments/files/34367773/use-56bea6.sh)
[use-56bea6.cpp](https://github.com/user-attachments/files/34367774/use-56bea6.cpp)
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to