https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115781
--- Comment #6 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
This bug depends on the dummy argument being a class.
Here's a somewhat shortened version:
program simple
implicit none
type :: matrix
integer :: nRows
end type matrix
type(matrix),dimension(:), allocatable :: mats
allocate(mats(2:2))
mats(2)%nRows = 2
call use_mats(mats)
contains
subroutine use_mats(x)
class(matrix),dimension(:),intent(IN) :: x
if (x(1)%nrows /= 2) error stop
end subroutine use_mats
end program simple