<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/149700>149700</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [Flang][OpenMP] flang/lib/Support/OpenMP-utils.cpp:16: mlir::Block *Fortran::common::openmp::genEntryBlock(mlir::OpBuilder &, const Fortran::common::openmp::EntryBlockArgs &, mlir::Region &): Assertion `args.isValid() && "invalid args"' failed.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            crash,
            flang:openmp
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          k-arrows
      </td>
    </tr>
</table>

<pre>
    Crash itself is reproducible on Godbolt:
https://godbolt.org/z/Pb5eMzbca
```f90
integer :: i, ior
!$omp parallel reduction (ior:i)
!$omp end parallel
end
```

With assertion-enabled flang, compiling the above reproducer results in the following assertion failure:
```txt
flang_test/llvm-project/flang/lib/Support/OpenMP-utils.cpp:16: mlir::Block *Fortran::common::openmp::genEntryBlock(mlir::OpBuilder &, const Fortran::common::openmp::EntryBlockArgs &, mlir::Region &): Assertion `args.isValid() && "invalid args"' failed.
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzsVEGPmzwQ_TXDxUpkhkDCgQPZ_fhOq121UnusDB6Iu8ZGtsl299dXhjTZtpf2XimHif3mefTePIT3ajBEFeRHyO8TMYeTddXzRjhnX3zSWvla3TnhT0wFT7pnyjNHk7Ny7lSriVnD_reytTpAVgOvTyFMPpbYADbDerW1bgBs3gCbpzanh7e2E8BrKPj660sOvFYm0ECOxe6sZgrwjinrIhBTwJ0dJzYJJ7QmzRzJuQvKGgZ4iKisVoDlT2Ay8toAvCYj3z8aa15_VuHEhPfkItmGjGg1SdZrYYY4QGfHSWllBhZOxERrz3QVgBxz5GcdPFNmue-t1vYloq-UrBdKz45Wea6vh28BeL088yWQD4CN1udxMzn7lbr49zJCo1UL2Hycp8m6eP44kXl42sxBab_tpgmyOi2iYKNWbtXuqG33zADrxrrghFlPOzuO9lLbicw4rfVA5j8T3OvSBXi48TxOx1lpGT3BYlXD-MD-iPVGWbvB_yC4cX-gYXWviLZlNauvikHBhRv8VvlPQisJeAAsV2TBAFGZczxnEQSIgPtFZJLb9wonsspkmZUioSrd5xlP02yfJ6eq2Ik0xzbrC9wdDhLTvcA-7wTxQ9sVnCeqQo4532NsKdJ8W2YF5ZksDy21newz2HEahdLbaFlc7kR5P1OV7so954kWLWm_ZAqxi-lZprwDxNXUq1KIMXWuWqxv58HDjmvlg78xBxX0ks9mac3vIT-uKwD5Pfu3JH-_JMnsdPXLd0qF09xuOztecvh7HBeHPWBzMflc4fcAAAD___O7opQ">