The following trivial program works fine with gfortran, ifort 11.1 20100806 and ifort 12.1.0 20110811, but crashes with segmentation fault if compiled with ifort 12.1.3 20120212 or ifort 13.1.0 20130121:
program bad implicit none type x integer(kind=4), dimension(128) :: a end type x integer, parameter :: s = 126 integer :: istat type(x),dimension(:,:,:),allocatable :: N allocate(N(0:s+1,0:s+1,0:s+1),stat=istat) if(istat /= 0) then print *, "allocation failed" stop end if N(0:s+1,0:s+1, 0) = N(0:s+1,0:s+1,s) N(0:s+1,0:s+1,s+1) = N(0:s+1,0:s+1,1) deallocate(N) end program bad
If the internal array size in the type definition is changed to anything less than 128 elements, everything works fine. Looks like a magic number of 2^30 (128*128*128*128*4) is somehow involved in this. Please advise what to do. Yes, I can re-write the corresponding loops manually and then the code starts to work, but that completely misses the point...