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

    <tr>
        <th>Summary</th>
        <td>
            [flang][debug] Lower bounds are ignored for assumed size arrays.
        </td>
    </tr>

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

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

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

<pre>
    Please look at the example code below.

```
subroutine sub (arr)
 integer :: arr (2:10, 5:*)

  arr(4,5) = 5
  return
end subroutine

program main
  integer :: test(20, 30)
  test(:,:) = 1
  call sub(test)
  print *, test
end program main
```

When stopped at line 5, here is what GDB shows for arr:

```
(gdb) ptype arr
type = integer (2:10,*)
(gdb) p arr(4,5)
$1 = 1
```
which is clearly wrong. The value should have been 5. The reason is that we are not providing the correct lower bounds in this case.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8U83O2yoQfRq8GX2WjU2uvfAiX6LczV3cRaWusZkYWgIWP0nTp6_A-WsqVYpIyOEM55wZuPdqNogDYZ-EUj4qIQmlhO0LHoO0bsh_FaMV1-F_jdwjaGu_Aw8QJAL-4KdFI0xWIIyo7aUk1Z5U29u6qW6fvPVxdDYGZRB8HIHQjjtHaL-ioEzAGR2QZkuaLXDn0hFKmm1dEboDlgC6fRBuNMhFupbQHSO0B9Lsgd0xhyE6s-7QCHhKeK2xODs7foITV-bOfFMT0IekJitpqqfqO5LF7fK6aqjvByaudbqY0G49-6AuTpkA2dNurfMQ-qektzDX9atEAz7YZUGRmqJTuCyVk-gQlIeL5AH-3X-Cl_bi4WhdDqzZ_qVRhHazGJORJVwXzIQM5F0y90jnpUG_9eZZ4a0_d7ytX1N6E3CRapJJ_aSRO32Fi7NmLuGLRDhzHTG5iVqA5Oc0eGiArahD7q1J1JCMX5J4BGNDSvSshDJzntzJOodTAG0v6GC00QgPykCQ6VbusSzE0Ii-6XmBQ_0P3dRsU3VtIYeuPXK2acXY02ozVjWbmnraHBlllFM89oUaaEXbqq9pzdquakvGRiom3jRCtLTZ9KSt8MSVLrU-n0rr5kJ5H3Goq66t60LzEbW_vcmj5ma-vUk3JMLHGGdP2korH_yzRFBB54e8MtiesE-BY0w_4b9XmykRNRvrUKzz4H08oQCvfuZe86svi-j0IENYfB7pA6GHWQUZx3KyJ0IP6drb18fi7DecAqGHbMMTerg5OQ_0VwAAAP__fdJKYg">