The following extract shows a compiler bug encountered with a much larger program. The bug is related to the use of vector subscripts.
The bug goes away if 4-byte integers are used instead of 2-byte integers.
program bugsal
implicit none
integer, parameter :: short = selected_int_kind(4)
integer(SHORT), parameter :: NIW=70
INTEGER(SHORT),DIMENSION(NIW) :: IW
IW(2)=0
IW(3)=0
IW(22)=69
call SUB(NIW,IW)
stop
end program bugsal
SUBROUTINE SUB(NIW, IW)
IMPLICIT NONE
integer, parameter :: short = selected_int_kind(4)
INTEGER(SHORT), intent(in) :: NIW
INTEGER(SHORT), intent(in) :: IW(NIW)
INTEGER(SHORT) :: JW(2)
INTEGER(SHORT) :: IOIB
IOIB=1
JW=2+IW(IOIB+1:IOIB+2)+20
write(*,'(1x,2I8)')JW ! JW is [22,22]
JW=IW(JW) ! causes crash with read access violation
! should have become [69,69]
write(*,'(1x,2I8)')JW
RETURN
END SUBROUTINE SUB