I am refreshing openmp a bit, and got into this weird situation. Shaved off the bunch, I created this minimal trivial case that shows the issue
program ex2
implicit none
integer, parameter :: n=10000000
integer :: i
real :: x(n)
do i=1,n
x(i) = 0.0d0
enddo
end program
with no flags specified, gfortran 4.3.4 on the mac (10.6) compiles, and the program executes correctly.
However, if I enable openmp with -fopenmp, the program terminates with segmentation fault. No code get executed, apparently, as it crashes immediately. As you see, openmp is never used in the code to parallelize anything. I tried to modify the stack size, both with ulimit the -fmax-stack-var-size, and in any case, ten millions reals is not what I define a big array.
What am I doing wrong ?