<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/60872>60872</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[flang][OpenMP] Compilation error of FIRSTPRIVATE clause of the OpenMP do directive in subroutine
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ohno-fj
</td>
</tr>
</table>
<pre>
```
Version of flang-new : 17.0.0(3e0866bf616bf7b293cec93d06d030dd11d7911f)
```
`FIRSTPRIVATE` clause of the OpenMP `DO` directive in the subroutine causes a compile-time error.
The following are the test program, flang-new, gfortran and ifort compilation result.
omp_PARALLEL_DO_304i_5.f:
```fortran
program main
integer*4 ib(10), ic(10)
do i=1,10
ib(i) = (i-mod(i,30))*(-1)**i
enddo
!$omp parallel
call sub(ib, ic)
!$omp end parallel
end
subroutine sub(ib, ic)
integer*4 ib(10), ic(10)
!$omp do firstprivate(ib)
do i=1,10
ic(i) = ib(i)
enddo
!$omp end do
return
end
```
```
$ flang-new -flang-experimental-exec -fopenmp omp_PARALLEL_DO_304i_5.f
error: loc("/home/users/ea01/ea0178/CT/fort/tp/reproducer_OpenMP/fomp_integer/omp_PARALLEL_DO_304i_5.f":11:7): operand #0 does not dominate this use
error: verification of lowering to FIR failed
$
```
```
$ gfortran -fopenmp omp_PARALLEL_DO_304i_5.f
$
```
```
$ ifort -qopenmp omp_PARALLEL_DO_304i_5.f
$
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVV1v6ygQ_TX4BTkCHH89-ME3uZYqddWqW93XCJtxwhUGL-D27r9fYTtpGrXaNopkGODMzJk5wJ2TRw1QofQHSvcRn_zJ2MqctIn731FrxL8Vysj6J3tE6l9gnTQamx73iutjrOEVo6TGNN-QDUGsSIAUWdb2Gc3aPm9ZmXTQlYkgmSAJEYJSkZeU9oiVC-SNh4uxuXv6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