<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/88935>88935</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Flang][OpenMP] assertion failure on reduction
</td>
</tr>
<tr>
<th>Labels</th>
<td>
flang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ye-luo
</td>
</tr>
</table>
<pre>
reproducer main.f90
```
program main
implicit none
integer:: i
REAL(8) :: EtsvdW_period
REAL(8) :: HtsvdW_period(3,3)
!$omp parallel do reduction(+:EtsvdW_period) reduction(+:HtsvdW_period)
do i=1,10
enddo
endprogram
```
compilation failure.
```
yeluo@jlselogin5:~> flang-new -fopenmp main.f90
flang-new: /gpfs/jlse-fs0/users/yeluo/opt/llvm-clang/llvm-project-nightly/llvm/lib/IR/Instructions.cpp:3292: static BinaryOperator *llvm::BinaryOperator::Create(BinaryOps, Value *, Value *, const Twine &, Instruction *): Assertion `S1->getType() == S2->getType() && "Cannot create binary operator with two operands of differing type!"' failed.
```
compilation works after being changed to
```
!$omp parallel do reduction(+:EtsvdW_period, HtsvdW_period)
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVE2v4jYU_TWXjQWKbz5IFlnw4KFWajXVzKhdVia-CZ46tmU7g9j0t1dO4A3vldVICORzvw7X51iEoAZD1EL5AuVhJaZ4tr690lpPdnWy8tp6ct7KqSPPRqHMpm8yyA6Q7aDKbp_56LwdvBjnpAVhTI1Oq05FZqyhW9U9ZCIN5CHfQb5j6gZ_ft39BljXgA27hV5j-C7_-tuRV1beq5_k_fIuD-sccJ8DNu_HAnLAwo6OOeGF1qSZtMyTnLqorAGsAV8g372fis2TlA8Dm_sIaZmC_MAB9zy7g2SktI9UyMjbxp5us7OjU1qkgawXSk-eNk8Tr6QnC0X2TQfSdlCmhHz3L-SvrNfCDGtDF7burSMzurcLZEvtW0baH-BxcH0APKZW6z5kgMcpkE_QMgWP1kXAo9bfx3WXiu8H5-036uLaqOEc9fUGpx91Ajz--jl9mRD9ssOw6ZyDfJdjg2l2iCKqjr0oI_z1kyMvovUMcDd3me_3fWzB9p5EJMD6HgyAe_an0BOl4v8dOmtCZF8vyiSoStADqSWrSXx2IZBfsCr7wteQvw4Uv14dzbefNHeA_MC-4JNQalwxQNwLY2xk3cySnWaOzN7_3UXFM4sXuyBGBmZ7JlXfk1dmYHHuyAERcDtLgORzBTxK5WL9P4GJPpJnJ0p9urMwA0kW7dPin3bE_qPhmqf9V7LNZZM3YkUt3_Ic621dbVfntpDUiIIXJfKKl1VVZFj126Yvy7rIeNatVIsZFlnBK77l26LaNFLKhjjnvegKXuZQZDQKpTdJJBvrh5UKYaK2rpu8XGlxIh3mdw2xX7SK6Ynz7azY0zQEKDKtQgw_OkQV9fwYHueK8gDlyydH5vc_oDww8SaLmyWZNT82xVaT1-05RheSPPGYHKXieTptOjs-WOLBMIDHmXTy2Mz7vwAAAP__nKWw2w">