[flang] Passing vector type to MERGE causing UNSUPPORTED type assertion
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Consider the following code:
```fortran
program vec_fir_box_ice
vector(integer*4) va(1), vb(1)
integer*4 sa(2), sb(2)
equivalence(va, sa)
equivalence(vb, sb)
logical mask(1)
mask(1) = .true.
sa = (/ 1, 2 /)
sb = (/ -1, -2 /)
! merge() on vector() array: at -O0 this produces a fir.box with
! mlir::VectorType element type, triggering the ICE.
vb = merge(va, vb, mask)
print *, 'sb(1)=', sb(1), '(expected 1)'
print *, 'sb(2)=', sb(2), '(expected 2)'
end
```
Flang currently outputs:
```
unsupported type
UNREACHABLE executed at flang/lib/Optimizer/Dialect/FIRType.cpp:589!
```
Expected output:
```
sb(1)= 1 (expected 1)
sb(2)= 2 (expected 2)
```
Contributor guide
Assessment
This issue has not been assessed yet.