<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/85597>85597</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Flang][OpenMP] Incorrect execution result of the value of private variable after the task construct is executed
</td>
</tr>
<tr>
<th>Labels</th>
<td>
openmp,
flang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ohno-fj
</td>
</tr>
</table>
<pre>
```
Version of flang-new : 19.0.0(00efb343529cce025055ca8284a61b22b48924c9)/AArch64
```
`Parallel` construct contains `task` construct. A variable is declared `private` in `parallel` construct, and its value is updated in `task` construct, but the value after leaving `task` construct is incorrect.
The following are the test program, Flang-new, Gfortran and ifort compilation/execution result.
omp3_task_013_4.f90:
```fortran
program main
integer::a=10
!$omp parallel private(a)
a=5
!$omp task
if (a.eq.5) then
a=a+1
endif
!$omp end task
!$omp taskwait
if (a.ne.5) then
print *,"inside of parallel NG:a=",a
end if
!$omp end parallel
if (a.ne.10) then
print *,"outside of parallel NG:a=",a
endif
print *,"pass"
end program main
```
```
$ export OMP_NUM_THREADS=2; flang-new -fopenmp omp3_task_013_4.f90; ./a.out
inside of parallel NG:a= 10
inside of parallel NG:a= 10
pass
$
```
```
$ export OMP_NUM_THREADS=2; gfortran -fopenmp omp3_task_013_4.f90; ./a.out
pass
$
```
```
$ export OMP_NUM_THREADS=2; ifort -qopenmp -diag-disable=10448 omp3_task_013_4.f90; ./a.out
pass
$
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0VU2P2zYT_jXUhbBAjUTbOuhgr1_n7WGTRZv2alDSSGZCkQpJedN_X1Afu2uvU7RAahiQOJpn5pkPzgjnZKsRC8L3hB8iMfizsYU5a7NqvkSlqf8syJrNf3YgbPcHWieNpqahjRK6XWl8piTd0SSPWcwIbBnDpkyzlENeVciAM84rsYVtJtZJCVBm2xyyKieQEzjudrY6r7PJ-I2vF-GTsEI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