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

    <tr>
        <th>Summary</th>
        <td>
            Flang OpenMP: reduction with minus operator not supported
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            flang
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          mwetzstein
      </td>
    </tr>
</table>

<pre>
    
Currently, reduction operations with minus are not supported and trigger
<code>
error: The minus reduction operator is deprecated since OpenMP 5.2 and is not supported in the REDUCTION clause.
</code>

Such minus reductions are currently used in various production codes, so sticking to OpenMP 5.2 and not supporting them will break such applications and require source code changes.

I request supporting the minus operator in reductions, so that flang can compile such applications out of the box without source code changes in the applications.

Here is a small reproducer which just does a simple reduction loop over one array: [omp_minus_reproducer.F90.zip](https://github.com/user-attachments/files/21603939/omp_minus_reproducer.F90.zip)

</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx8k09v4zYQxT8NdRlEoChRjg86OE6E5tCmaNNzQFFjiQlFqvxjb_LpF5SdtdcIcrIhcN783psZ4b0aDGJD-B3h95mIYbSumQ4YPnxAZbLO9u8NoZttdA5N0O-EbcFhH2VQ1oCd0Yn0z8NBhREmZaIH4RCMDeDjPFsXsAdheghODQM6Qjek3ErbIykfCN2gc9aRcgPPI57qr_WtA-Whx9mhFEnOKyMRnmY0f_4NPGeLvvJXTZWBMCL883D_3_b58ekvkFpEj_mRgLD2DEHo5t8ox-v-Ryvy0ztEf5TdC6ds9DA7-0matHwKx1vwQck3ZQYI9hrygnB5MOIEB6U1dA7FG_gEIeZZK3mKNRU5_D8qh-BtdBKXViBHYQb0-RH-cXmD_lr8ZOgco7kwd6INowiw08IMIEUyMs1K4xcoNgawu0W2sz-WgadPX1B9Rn9ZfiL9Ax2mUQnwk9AaHB5DRAeHUckRXqMP0Ftcnqhp1nixD9raGeweHViDIJwT72l1CL-z0_yymH05K-btmuYfaib8nrDbMYTZk3JDWEtYO6gwxi6XdiKsjR7djQhByHFCEzxh7U7pNM-WFTUt1-WasPbbFmxN6Cbrm7Jfl2uRYVOseFUVrOZ1NjZ1UfFVV-9WPVutRCEK2VFKK15VtFuLUmSqYZRxekt5UXPK61zwqliJ-rZn2AvBJakoTkLpXOv9lFs3ZMr7iE3BWbGqMy061H65Y8aWYRLG0km7JhXcdHHwpKJa-eDPEkEFjU27zP64qCnNc9wXN_1rhX67sSw63XwTbOp0-rmZnX1FGQhrF_IU7gl-37CfAQAA___2nZDI">