https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85868

--- Comment #4 from Harald Anlauf <anlauf at gmx dot de> ---
Reduced testcase:

program pr85858
  implicit none
! integer, allocatable, target :: t(:)
  integer, pointer             :: t(:) => null()
  integer :: i, lb = 0  ! run under debugger, or set lb to 1
  allocate (t(lb:10))
  do i = lb, 10
     t(i) = i
  end do
  print *, t(1)
  call te (t(1:))       ! Offset should depend on 1-lb !
contains
  subroutine te (a)
    integer, pointer, intent(in) :: a(:)
    print *, a(1), lbound (a, dim=1)
  end subroutine te
end program


For lb=0 this prints

           1
           2           1

while it should print only 1s (as I get with gfortran 8.2.1).

Reply via email to