g77 question.

Walter Kasberg Walter.Kasberg@web.de
Fri Mar 2 10:16:00 GMT 2007


On Thursday 01 March 2007 18:08, Fabio De Colle wrote:
> Hi!,
>
> I compile this small code with g77 (gcc-3.4) --> no error. But when I
> run the code I have a
> "Segmentation fault".
> Please someone can tell me where is the error?
> Please note: commenting the call to the subroutine s2 --> no
> segmentation fault!
> Cheers
>
> Fabio
>
>
>
>       program test
>       parameter(n=3000000)
>       call s1(n)
>       stop
>       end
>
>       subroutine s1(n)
>       integer m1(n)
>       call s2
>       return
>       end
>
>       subroutine s2
>       return
>       end
I am not sure but suppose that could be due to possible segment limit in f77. 
If you ommit s2 perhaps it just fits into this limit.

Perhaps you can try to put n into a common block. Maybe that could work,

I tried your code with g95 (Mandrake g95-0.50-1.403_20060327.1mdv2007.0) and
gcc-gfortran (Mandrake gcc-gfortran-4.1.1-3mdk). Both work.

Walter



More information about the Gcc-help mailing list