<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/71370>71370</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Flang][OpenMP]Incorrect execution result when reduction-identifier(+) is used in REDUCTION clause
</td>
</tr>
<tr>
<th>Labels</th>
<td>
flang:frontend,
flang:openmp
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ohno-fj
</td>
</tr>
</table>
<pre>
```
Version of flang-new : 18.0.0(1c876ff5155c4feeb2b2885eb3e6abda17c4b7f4)
```
Using `reduction-identifier(+)` in `REDUCTION` clause results in incorrect execution.
The program is executed on 1 thread and expects a value of 11 for a.
The following are the test program, Flang-new, Gfortran and ifort compilation result.
ompds111_2.f90:
```fortran
program main
integer :: a
call OMP_SET_NUM_THREADS(1)
a=1
!$omp parallel reduction(+:a)
a=10
!$omp end parallel
print *,a
end program main
```
```
$ flang-new ompds111_2.f90 -fopenmp; ./a.out
10
$
```
```
$ gfortran ompds111_2.f90 -fopenmp; ./a.out
11
$
```
```
$ ifort ompds111_2.f90 -qopenmp; ./a.out
11
$
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVE2P2zYQ_TXUZWCBpD590MG7Xrc5bDZIdns1KGokMaBIlaSy6b8vaMvOxikKbFHDkMDR8L2ZeeQT3qvBIDakuCPFPhFLGK1r7Gjspv-atLb7qyElXf90T-juD3ReWQO2h14LM2wMvgLJdsDqlKaU8JrJuir7vmBFIfMeseUtr-sC2wxL0XaCVTJvqz4nfHuGvGE4P1-8MgOQkjrsFhmUNRvVoQmqV-gIrwm_iwAlBWVi2ueH_cv984enjzEktVg8gkO_6OBjhjLSOocyAH5HuUS8FOBM9TwizM4OTkyg_JqAHVgDDMLoUHQgTAf4fUYZPAj4JvSCcQSMQW8diPRt6RGvt1rb19iCcAhhRAjow4WG8Hs4XKYXF7_11gUnzIlHxQVIO81Ki1jp2shPJHaaO88YO_K031KS7W5muQKeo5fuJqHWCIAyAQd0Ubson7jEpdAanh4_Hb88PB8_vjwen3___LDbf4nKXiUDECTbs5WTM8JzO80wCye0Rg1X0Valsp243UtvN6PprgCXzNkpE4DwHeH3a4WntF_6-cczdBvk-Zsz-_MAYdPbGc00k-wOUsIPIrVLWMv4UWv-PrbhIus7yK4_xv4j6_n83FL--T9QJl2TddtsKxJsWLnd8pJTWidj07ayyOquq7GVoiyKouIVxZrLTFRYl5iohlOeMUZLumUZr9NaSKxz3pdZLVvsK5JTnITSqdbfptS6IVHeL9hULKtookWL2p9sivOThiTb9c6agKYjnBN-_-bD2inn0dNcExE37TJ4klOtfPA_OIIK-uR-p9tIij0p7p5mNI-fSLH_8KtnrDcRXkc08K_OFJ1k8dhF87l602pMyeJ0M4Yw-3j5-IHww6DCuLSptBPhh1je-trMzn5FGQg_nObhCT-cRvJ3AAAA__9V6Kfb">