[Bug fortran/50201] gfortran with -static causes seg fault at runtime for writing double prec array with precision increased to kind=16
kargl at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Aug 26 21:00:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50201
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kargl at gcc dot gnu.org
--- Comment #1 from kargl at gcc dot gnu.org 2011-08-26 20:54:56 UTC ---
(In reply to comment #0)
> It appears that the combination of -static and promoting 'double precision' to
> kind=16 causes problems for writing an double precision array. Either changing
> from array to scalar, or removing -static avoids the problem.
>
> Writing quad scalar with -static is fine:
>
> > cat fdp2.f90
> double precision :: x
> x = 3.4
> print *, kind(x)
> write (*, "(f10.3)" ) x
> end
> > gfortran -fdefault-real-8 -static fdp2.f90
> > ./a.out
> 16
> 3.400
>
> Writing quad array with -static -> segfault.
>
> > cat fdp1.f90
> double precision :: x(4)
> x = 3.4
> print *, kind(x)
> write (*, "(4f10.3)" ) x
> end
> > gfortran -fdefault-real-8 -static fdp1.f90
> > ./a.out
> 16
> Segmentation fault
>
> But is OK without -static:
>
> > gfortran -fdefault-real-8 fdp1.f90
> > ./a.out
> 16
> 3.400 3.400 3.400 3.400
> >
What operating system?
It works for me.
troutmask:sgk[207] gfc4x -o z a.f90 && ./z
8
3.400
troutmask:sgk[208] gfc4x -o z -static a.f90 && ./z
8
3.400
troutmask:sgk[209] gfc4x -o z -static -fdefault-real-8 a.f90 && ./z
16
3.400
troutmask:sgk[210] gfc4x -o z -fdefault-real-8 a.f90 && ./z
16
3.400
More information about the Gcc-bugs
mailing list