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

    <tr>
        <th>Summary</th>
        <td>
            [flang][OpenMP] Incorrect result from reduction of array with non-default lower bounds
        </td>
    </tr>

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

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

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

<pre>
    ```
program reduce
integer, dimension(2:4) :: i = 0

!$omp parallel reduction(+:i)
i(3) = 3
!$omp end parallel

print *,i

end program
```
```
flang-new -fopenmp file.f90 -o out && ./out
```

The program should print an array with three elements: `0 n 0`, where `n` is 3 times `OMP_NUM_THREADS` (which is usually the number of logical cores on your machine). Currently flang outputs `0 0 0`.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsU02vq0YM_TVmYyUiHiCwYMFNGrWL2_fUvq6fBjAw1TCD5qNR_n3FR_turyqhQRzs43Nsj_RejYa5hvwNiEKr5QREkN8TGcNkXb1BSWv7Vw1FejzpHdJmcXZ0ckbHfex4x5QJPLIDumGvZjZeWQNUEogmA6oQRAOiQYUg7njwHCddgDI7L7hIJ7VmvROHnQHoDUSjgKqjEFApdsY7is8UbPp_aT4WWZwyAYEaoJv6-GNL2P0c8H-9fvoctDTjyfATT4Nd2MwLDkrzeahSPFm0cS1SABV4BnrYGP6fdDu_TfxPafSTjXpVssqUBqVz8oVPFSYMk2NG1jyzCX5tIhRpigY3Prrhc2LHK2igSFF5FBjUzH6Fvrx__f7rH-_fv_3820_N_fc1AKh8Tqqb1sjoo9T6hWFiNHFu2aEdUNtRdVJjZx17tAZfNjqcZTcpw0DVGW_ROTZBv3BryOp7icHvytJN2Tnpa9FXopIJ15frRWR5UZUimerLdaD8SkObcV8NQyuLIr9S2nNJuSyqNFE1pZSl2aW8FJeCxFlchv6aloUgyoqKBshSnqXSZ63_ms_WjYnyPnJdVpRXiZYta38s9qYPRLMP69hwV6-JpzaOHrJUKx_8D6qggt6uxZ6a3yF_-7Kwef8K-R1_MZ11jruAjn3UAQdn5x8Lu7bvw-yMNaeeB7kGavtkh62NpvdJdLqeQljWeQI9gB6jClNsz52dgR6rmON1Wpz9k7sA9NhMeqDH5vPvAAAA__-kmCIx">