contiguous_array_section: unexpected dimension type

We have some code which generates an internal compiler error with pgi 17.1 and 16.10 and is perhaps a bug:

SUBROUTINE example(p)
 DOUBLE PRECISION, POINTER, DIMENSION(:,:), INTENT(in) :: p
 CONTIGUOUS :: p
 DOUBLE PRECISION, POINTER, DIMENSION(:) :: p1
 CONTIGUOUS :: p1
 p1(1:SIZE(p)) => p(LBOUND(p,1):LBOUND(p,1)-1+SIZE(p),LBOUND(p,2))
END SUBROUTINE example

Which gives:

> pgf90 -c test.f90
PGF90-S-0000-Internal compiler error. contiguous_array_section: unexpected dimension type       0 (test.f90: 6)
PGF90-S-0000-Internal compiler error. contiguous_array_section: unexpected dimension type       0 (test.f90: 6)

We are for now using the following workaround:

SUBROUTINE example(p)
 DOUBLE PRECISION, POINTER, DIMENSION(:,:), INTENT(in) :: p
 CONTIGUOUS :: p
 DOUBLE PRECISION, POINTER, DIMENSION(:) :: p1
 CONTIGUOUS :: p1
#ifdef __PGI
 INTEGER :: l1,l2
 l1=LBOUND(p,1); l2=LBOUND(p,2)
 p1(1:SIZE(p)) => p(l1:l1-1+SIZE(p),l2)
#else
 p1(1:SIZE(p)) => p(LBOUND(p,1):LBOUND(p,1)-1+SIZE(p),LBOUND(p,2))
#endif
END SUBROUTINE example

We have replicated this, and we have logged this as TPR 23912.

thanks,
dave

TPR 23912 - pgfortran ICE " p1(1:SIZE§) => p(LBOUND(p,1):LBOUND(p,1)-1+SIZE§,LBOUND(p,2)) "

has been corrected in the current 17.5 release.

thanks,
dave