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

    <tr>
        <th>Summary</th>
        <td>
            [Flang] An array store operation is incorrectly recognized as a statement function. This causes updates to the array to be lost. A Walk over the parse-tree (in flang/lib/Semantics/rewrite-parse-tree.cpp)  generally corrects all such statement functions to arrays accesses, but not clear why that did not happen here.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    Investigate and create a fix for this issue. A minimum reproducer is given below.
```
module md1
  integer, dimension(1) :: np
end module
subroutine sb(x,y)
  use md1
  integer :: x, y
  np(x) = y
end subroutine
```

This issue was found while investigating 554.roms_r.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxtU01v2zAM_TX2hajhOHbqHHzIVgTYeQN2HGSJtrXKkkFJSbNfP0pp2ksBwRIlfjy-R49O3YYf9oI-6FkEBGEVSMJ8hEm_weQIwqI9aO8jVnCCVVu9xhUIN3IqSiR-g1lf0MKIxl2ron4p6lNxqN9XNlf2NQir2t1tAG0DzkhF8x2UXtF67WzR9LuiOUKxP_ECu92dkWHdE9xtH0dyMWiL4EeOeeMkN457pI7-q0qPrMkbbo9HrpETpKIvj-tU8LPIlw3dv78-uIGr8ExX5MjrorlV_cGrtjN0XVuRW_0fqko17NVxfxRl0MHgUHTfzkbYuehe4GRBEIkb-OAIwW1IHO9s4lhb6YhQBnNj9qWbrf6HCrisYHfWjEkMMEUrU0QFGZsUTIaHuCl28BAcy4nvNdgYEYzzIQn7W5hXcBek7LEJ8vgUCBGYH21hyhCbs9HM-PknrsIGLT2fCa-kAz59hlRy2xKjMKPlBgwDfofOWI1hauXyBeQML0NjNynRM_Kk1RgDWBdAGhTE7DLyRQSeGpWvF7FtPHwLElZlJDMsIWw-id2cec06LHGspFsTenN5bE88v38ZEptZwNRK1_X7tlyGad90x_7Q4fOhF6rtx_E4KRTd2Oynrp1EaQTPuk_SFU1j8XqfAT6ziKUemrpp6kPd7Nrdbneo-mmSfdsJ9azaSUlVtDXzp02VcFSO5pKGDGmMs-dHo33wn4_Cez1bzJOS8osYFkfDqyZh5cL_LInV8V5mEENu4j-800V8">