Closed
Description
Consider the following testcase. When stopped on line 4, the is what gdb prints for arr variable.
(gdb) p arr
$1 = ((1, 2) (3, 4))
While the result should have been $1 = ((1, 2) (5, 6))
. The problem seems to be missing stride information on the array type.
subroutine show (arr)
integer :: arr(:,:)
print *, arr
! This write is to ensure that variable is not optimized out
arr(2,1) = 15
end subroutine show
program test
interface
subroutine show (array)
integer :: array(:,:)
end subroutine show
end interface
integer :: parray(4,4) = reshape((/1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16/),(/4,4/))
call show (parray(1:2,1:2))
end program test