This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/50201] New: gfortran with -static causes seg fault at runtime for writing double prec array with precision increased to kind=16
- From: "longb at cray dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 26 Aug 2011 20:22:26 +0000
- Subject: [Bug fortran/50201] New: gfortran with -static causes seg fault at runtime for writing double prec array with precision increased to kind=16
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50201
Bug #: 50201
Summary: gfortran with -static causes seg fault at runtime for
writing double prec array with precision increased to
kind=16
Classification: Unclassified
Product: gcc
Version: 4.6.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: longb@cray.com
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
>