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

    <tr>
        <th>Summary</th>
        <td>
            [flang][debuginfo] Array with non constant extent is being treated as assumed size array.
        </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>
    The array with explicit shape with non constant extent is being treated as assumed size array. See the following program:

```
PROGRAM minimal
  integer arr(-2:3)
  arr(:) = 1
  print *, arr
  call change(arr, 6)
contains
  subroutine change(a, n)
    integer :: a(n)
    a(1) = 10
    print *, a
  end subroutine change
end
```

When stopped in subroutine `change`, the type of `a` is shown as follows:

```
(gdb) ptype a
type = integer (*)
(gdb) p a
$1 = <error reading variable: failed to get range bounds>
```
With correct debug information, it should be possible to get the extent of this array.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVE1v4zgM_TX0hWggy7FjH3xIm82eFrvoDtCzZNG2BrJkSHI_5tcP5DhNiynmMkCgJCTfE_lISoSgB0vUQnkPnAup1QicQ3nKxBJH59vVlEmn3tpvI6HwXrzhi44j0utsdKcjhlHMdLFZZ7FzNkRhI9JrJBtRB5Sk7YDRk4ikUAQUISwTKQz6x8a5w_-JMI6EvTPGvSTA7N3gxQTFEdgJ2PWs2PZZ__73-O_fj8d_cNJWT8JcjIjaRhrIJ3Lg9R2H4lgAb67uizkx8wahOGF-9cxe24jAj8Af1rDN3gljsBuFHQh4veIfsHqn7JyNQttwDQ-L9G6J2tIHUILYD1nc0kyZFEcUwOvPAcmSvyfJbo7PeV7tZNUXV69OsupLAS_n00gWQ3TzTAq1_UgCFdt4KpYuS02KbzOh65NPQMVSk8PoXmxq7qWB4fdtA14PSqbC5pVrq2D9nUp9F4bXa43NL7ArBPg-XyFQPJD3zqMnodL8PAuvhTSUlO2FNqQwOhwook_loHSLVQGKv77M8CkNdOe8py6iIrkMqG3v_CSidjYJsc6-W4xCSTi7ELQ0dL0iqbRtgOsxjjpsg56ptlBN0YiM2vzAc1bUVVNnY1vJcs86xapedmxPvC5lX0pqOiFzUR_qTLec8T075GXO8jqvd7yo-rpQeSeZyrkk2DOahDY7Y56nnfNDpkNYqG3q-tBkRkgyYVv13gg7bKvu2xR_J5chwJ4ZHWK4MUQdzfo-XBDlCcr7VY0kBpQnPN6ehD9Y_2zxph1jnNe54Wfg50HHcZG7zk3Azymf7etu9u47dRH4eS0vAD9fKnxu-c8AAAD__zOweI0">