<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/108633>108633</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[flang][debug] Lower bound for assumed shape arrays is ignored.
</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>
If an assumed shape array happens to have a lower bound, it is ignored by the generated debug info. See the example below.
```
subroutine show (arr)
integer, dimension (-2:) :: arr
arr(2) = 5
print *, arr
end subroutine show
program test
interface
subroutine show (arr)
integer, dimension (:) :: arr
end subroutine show
end interface
integer, dimension (15) :: arr
arr = 7
call show (arr)
print *, arr
end program test
```
When stopped at line 4, this is what GDB shows 7 as the value of the arr(2) while it should have been 5.
```
(gdb) p arr(2)
$1 = 7
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEVEGP2ywQ_TX4MtrIAduJDz5kvyifKvXWQ89DGBsqDBbgpPvvKxynG203rWWBYJiZ94Y3YIxmcEQdq18Z5yiN0oxzVh8LnJP2oVu2CunVW_elB3SAMc4jKYgaJwIMAd9A4zSRi5A8aLwQIFh_pQDSz04x_h-YBCaCGZwPpEC-QdIEAzkKmEiBIjkPYFzvN_CNaLHSTxwnSyDJ-uuGlUdWHtaxKdd_WcZZBj8n4wii9ldgfI8hMN7ezADGJRooZBzKjOSi8S6feuFMHBhvIU_ikLncXZYAe34zHqG-70_BuASMH3Kw9_PkFHyA8Qh4Cn4IOEKimB5BhR7PtG78k0X-njF5ygOeQ7uZPsJ4mmJbf5oBQ1gqtLv7n9HaJww-L15G8WeBPtzxbfyuyUFMfppIASawmVGVoyWd5RXhqjHB_8fXBUGEHWBcxHRBOxP4flk8XO5VG0tZnVH72aqbeiWRg_pvkmN8PyiZA0wP0e62avtYkt-uheqEakWLBXXbHW943VSiKXR37reiaak6V5I3XHBZKdmIXbUry7bp1b4wHS95VbZbsW2rUjQbodSOxJ4klrJuZM2qkkY0dmPtZdz4MBQmxpm6bblvhCgsSrJx7fHeohvWHg9ddniR8xBZVVoTU3wPkUyyy8Nw86iPrH5dGpXVR_j63t_Q-_DZqxAfWn5TzMF2OqUpLlo9MX4aTNKz3Jz9yPgpZ12nlyn4H3ROjJ8WFpHx00rk0vFfAQAA___MymiC">