MOVE_ALLOC

Hi,
I have a question regarding MOVE_ALLOC.
I have a big array and want to truncate the array after knowing the exact size. I modified the example from https://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/topic/281030
and try to run the following code

program test_truncate
  implicit none
  integer(4), allocatable, dimension(:) :: vec
  integer(4), parameter :: nn=100000000
  integer(4) :: sz, i
  allocate(vec(nn))
  do i=1,nn
    vec(i)=i
  end do
  do i=1,5
    sz=size(vec)/(i*10)
    call  truncate(vec,sz)
    write(*,*) i ,sz,size(vec), vec(SIZE(vec)) 
  end do 
contains
   SUBROUTINE truncate(array, sz)  
    INTEGER, INTENT(INOUT), ALLOCATABLE :: array(:)
    INTEGER, INTENT(IN) :: sz
    INTEGER, ALLOCATABLE :: tmp(:)
    tmp = array(:sz)
    CALL MOVE_ALLOC(tmp, array)
  END SUBROUTINE truncate
end program

with gfortan and ifort I get what I expect:
./a.out
1 10000000 10000000 10000000
2 500000 500000 500000
3 16666 16666 16666
4 416 416 416
5 8 8 8
However with pgfortan 17.10 I get
1 10000000 100000000 87096572
2 5000000 100000000 87096572
3 3333333 100000000 87096572
4 2500000 100000000 87096572
5 2000000 100000000 87096572

Please can you help me!

Best regards
André