Consider the following code,
subroutine bar(adj, n, m)
integer n, m
real*8 adj(n:m)
adj(n) = 7
end subroutine
program test
real*8 foo(100)
call bar(foo, 101, 200)
print *, foo(1)
end program
flang version 20.0.0 (https://github.com/llvm/llvm-project a2fb70523ac310af6d8a4d9663dfe7c9cd370c53)
Compile with Flang, no upper bound info in GDB
Breakpoint 1, bar (adj=..., n=101, m=200) at bug.f90:4
4 adj(n) = 7
(gdb) ptype adj
type = real (101:*)
Compile with GFortran gives,
Breakpoint 1, bar (adj=..., n=101, m=200) at bug.f90:4
4 adj(n) = 7
(gdb) ptype adj
type = real(kind=8) (101:200)
The problem is that neither DW_AT_upper_bound nor DW_AT_count is emitted for array adj in the DWARF.