Program to copy array with ifort crashes

This program crashes with Illegal instruction: 4on MacOSX Lion and ifort (IFORT) 12.1.0 20111011

program foo
      real, pointer :: a(:,:), b(:,:)
      allocate(a(5400, 5400))
      allocate(b(5400, 3600))
      a=1.0
      b(:, 1:3600) = a(:, 1:3600)

      print *, a
      print *, b

      deallocate(a)
      deallocate(b)

end program 

The same program works with gfortran. I do not see any problems. Any ideas? Deploying a copy and executing an explicit loop on columns works in both compilers.

Note that with allocatable, instead of a pointer, I have no problem.

The behavior is the same if the operator is either inside the module or not. I confirm the same behavior in ifort (IFORT) 12.1.3 20120130.

There seems to be no problem with Linux and ifort 12.1.5

I tried to increase the stack size with the following link options

ifort -Wl,-stack_size,0x40000000,-stack_addr,0xf0000000 test.f90

but I still get the same error. Strengthening ulimit -s to a tough problem.

2: , -, ,

      b(:, 1:3600) = a(:, 1:3600)

, 16 .

, , .

+5
2

( , ). , ifort , , . , , , , . ifort, -heap-arrays . .

ifort -o test test.f90 -heap-arrays 1600

- - , . . - , , . , . , Intel . .

+4

"allocatable" "pointer".

real, allocatable:: a (:,:), b (:,:)

.

+1

All Articles