| Issue |
178793
|
| Summary |
[Flang][OpenMP] Compilation error when 8-byte integer constant is specified for linear-step of LINEAR clause
|
| Labels |
flang:openmp
|
| Assignees |
|
| Reporter |
ohno-fj
|
```
Version of flang : 23.0.0(e5d235831dfb07b6e767812af7f9d3daa5896f78)/AArch64
```
In the attached program (`masa_do_linear_06_2.f90`), when 8-byte `integer constant` is specified for `linear-step` of `LINEAR clause`, it causes an error during compilation.
When 8-byte `integer constant` is changed to 4-byte, the compilation completes successfully.
The above program is `masa_do_linear_06_21.f90`.
The following are the test program, Flang, Gfortran and ifx compilation/execution results.
masa_do_linear_06_2.f90:
```fortran
program main
implicit none
integer(kind=8),parameter::N=100
integer(kind=8)::j=0
integer(kind=8)::i=0
!$omp parallel do simd linear(j:1_8)
do i = 1, N, 2
j = j + 1
end do
!$omp end parallel do simd
if(j==50) then
print *,'pass'
else
print *,j
endif
end program main
```
```
$ flang -fopenmp masa_do_linear_06_2.f90; ./a.out
error: loc("/work/masa_do_linear_06_2.f90":6:7): 'omp.simd' op operand #2 must be variadic of 32-bit signless integer, but got 'i64'
error: verification of lowering to FIR failed
$
```
```
$ export OMP_NUM_THREADS=2; gfortran -fopenmp masa_do_linear_06_2.f90; ./a.out
pass
$
```
```
$ export OMP_NUM_THREADS=2; ifx -qopenmp masa_do_linear_06_2.f90; ./a.out
pass
$
```
masa_do_linear_06_21.f90:
```fortran
program main
implicit none
integer,parameter::N=100
integer::j=0
integer::i=0
!$omp parallel do simd linear(j:1_4)
do i = 1, N, 2
j = j + 1
end do
!$omp end parallel do simd
if(j==50) then
print *,'pass'
else
print *,j
endif
end program main
```
```
$ export OMP_NUM_THREADS=2; flang -fopenmp masa_do_linear_06_21.f90; ./a.out
pass
$
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs