<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/81946>81946</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Flang][OpenMP] Compilation error of a host-associated allocatable variable in a `private` clause
</td>
</tr>
<tr>
<th>Labels</th>
<td>
openmp,
flang:frontend
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
yus3710-fj
</td>
</tr>
</table>
<pre>
This is an issue from Fujitsu testsuite.
A compilation error occurs when compiling a host-associated allocatable variable in a `private` clause.
The following are the test program and the compilation results of flang-new and gfortran.
```fortran
! test.f90
integer,allocatable::vs(:)
call ss1
contains
subroutine ss1
!$omp parallel private(vs)
!$omp end parallel
end subroutine
end
```
```console
$ flang-new -v test.f90 -fopenmp
flang-new version 19.0.0git (https://github.com/llvm/llvm-project.git a6b846ae1e58e11160185e427e20a995f6656859)
Target: aarch64-unknown-linux-gnu
Thread model: posix
InstalledDir: /path/to/install/bin
Found candidate GCC installation: /opt/rh/gcc-toolset-12/root/usr/lib/gcc/aarch64-redhat-linux/12
Selected GCC installation: /opt/rh/gcc-toolset-12/root/usr/lib/gcc/aarch64-redhat-linux/12
Candidate multilib: .;@m64
Selected multilib: .;@m64
"/path/to/install/bin/flang-new" -fc1 -triple aarch64-unknown-linux-gnu -emit-obj -fopenmp -fcolor-diagnostics -mrelocation-model pic -pic-level 2 -pic-is-pie -target-cpu generic -target-feature +outline-atomics -target-feature +v8a -target-feature +fp-armv8 -target-feature +neon -mframe-pointer=non-leaf -o /tmp/test-f4e165.o -x f95-cpp-input test.f90
error: loc("/path/to/test.f90":7:24): 'fir.allocmem' op invalid type for allocation
error: verification of lowering to FIR failed
```
```console
$ gfortran-13.2 test.f90 -fopenmp
$
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8VduO4zYM_RrlhZAhy5fED3nIzMDFPhQt2v0BRaYdTWVRkOTM7t8Xs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