https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94377
--- Comment #2 from Fred Krogh <siteg at mathalacarte dot com> --- I'm sorry, I made an error when making up this code from a much bigger one. There was a missing ')' at line 8. I've corrected this in the code below. Same kind of error here, but that code compiles on both Intel and NAG according to a friend. program pdt type :: av_t(n) integer, len :: n integer :: i real :: c real :: u(n) end type av_t type(av_t(:)), allocatable :: av(:) integer :: k2, k3 k2 = 3 k3 = 5 contains subroutine al_test(k) integer, intent(in) :: k integer :: ista if (k == 1) then allocate ( av_t(k2) :: av(k3), stat=ista) ! For this ista not needed return else deallocate(av, stat=ista) end if end subroutine al_test end program pdt