<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/60871>60871</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[flang][OpenMP] Compilation error when specifying a variable with the ALLOCATABLE attribute in the ALLOCATED intrinsic function
</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)
```
Compilation error when specifying a variable with the `ALLOCATABLE` attribute in the `ALLOCATED` intrinsic function.
The following are the test program, flang-new, gfortran and ifort compilation result.
omp_fp16_par_pri02_2.f90:
```fortran
program main
real(4),allocatable::a
allocate(a)
a=1.0
!$omp parallel private(a)
if (.not. allocated(a)) then
print *,'ng1: a'
endif
a=2.0
!$omp end parallel
if (a /= 1.0) then
print *, 'ng: a = ', a
endif
print *,'pass'
end program main
```
```
$ flang-new -flang-experimental-exec -fopenmp omp_fp16_par_pri02_2.f90
error: Semantic errors in omp_fp16_par_pri02_2.f90
./omp_fp16_par_pri02_2.f90:6:23: error: Argument of ALLOCATED() must be an ALLOCATABLE object or component
if (.not. allocated(a)) then
^
$
```
```
$ gfortran -fopenmp omp_fp16_par_pri02_2.f90
$
```
```
$ ifort -qopenmp omp_fp16_par_pri02_2.f90
$
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVU2PozgQ_TXOpRRkimDgwIFJOqdezUo72mvLQEE8MjZrm-6Zf78ySafTHzva3o0iEuxyvefnV2XpvRoNUc3yLyw_bOQSTtbV9mTsdvi-aW3_s2aCX778wHjzJzmvrAE7wKClGbeGnoBlDaRFwhPOsMyIl0K0g0hFOxQtVllHXZX1XPQ8432fpn1RpenAsDqnfINwfu7tNCstQ8Qi56yDpxMZ8DN1avipzAgSHqVTstUETyqcIJwImODN_f3XffOt-XJ_xwQHGYJT7RIIlHkTcneIAcoEp4xXHQyL6SJecsvj24lgsFrbpxXT0ZokkA8wOzs6OTHcv0gRX8bBuuCkAWl6UPEFupvdOPKLDq9Azk87zQ_DnIqHWbqH2SmOD5gMFWdZ80aoC8B59EIDJqkuIwCOpGZY7qLGuJda206GKFXMlTXyOe4yQwxLeT0PAMmyQ5o8nwemDHd2mmGWTmpNGmanHt-vUgMwLBNjQ3JN3D_HYBWFuxIEiElMAIYNwz3DwoxptJFkWDwHkenVcMsJ33Mi0195vSYigeGRZQeIO3kNfwsNK_YKDTE64uMe5Ick3nCepfdXviuTd2fxobnfDuLuppi257_0YyanJjJB6i39oA62g53JTDP8o1HOPGK1xP38QZM0QXXn-vGxAH69MmF4_IUJBcsazGLmK0TjxiVSjO3gpaqwjHpPiw_QEkgDNzUJtv1OXQDr1qKwhkx4McUnLfTBh-V3V1E_dwLXsv2XOn8a4NwKtn_9r-ybvs76KqvkhupUFKIsMi6Kzakeil2FeUodtlm5y9OiqkQpi7bnaZfmUmxUjRwzjsi54DsskhJbsctLLjj2qRQV23GapNKJ1o9TYt24Ud4vVAteFulGy5a0X28KxOjTdZIhxovD1XHNtl1Gz3ZcKx_8S5aggl6vmNXYLD-w_MvXmcxvv7P8AP-t0d866l2Lvzrxg-a-WZyuTyHMPrZCPDI8jiqcljbp7MTwGFlffrazs9GrDI_rXj3D46rF3wEAAP__qEMZYQ">