Segmentation fault with conditional pointer assignment from different address spaces
Open
- Dominant language
- LLVM
- Stars
- 729
- Forks
- 110
- Avg merge
- 17h 51m
- Merged PRs (30d)
- 23
Description
```cpp
kernel void exec(global float *in, global float *buf) {
float tmp[32];
float tmp2[32];
float *in_ptr = in;
float *out_ptr = tmp;
for (int j = 0; j < 4; ++j) {
for (int k = 0; k < 32; ++k) {
out_ptr[k] = in_ptr[k] * buf[k];
}
in_ptr = out_ptr;
out_ptr = out_ptr == tmp ? tmp2 : tmp;
}
}
```
Results in:
```llvm
%6 = load float, ptr addrspace(4) %arrayidx, align 4
:
OpPtrAccessChain is not supported for this storage class
UNREACHABLE executed at ../clspv/lib/SPIRVProducerPass.cpp:4946!
Aborted (core dumped)
```
Godbolt link: https://godbolt.org/z/vx91zr9Po
Contributor guide
Assessment
This issue has not been assessed yet.