This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/25628] New: Runtime error on write to string of global variable length
- From: "eedelman at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Jan 2006 18:48:49 -0000
- Subject: [Bug fortran/25628] New: Runtime error on write to string of global variable length
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
$ cat bug.f90
module foo
implicit none
integer :: strlength = 20
contains
subroutine bar()
character(len=strlength) :: str
write (str, *) 0
end subroutine bar
end module foo
program test_foo
use foo
implicit none
strlength = 10
call bar()
end program test_foo
$ gfortran bug.f90
$ a.out
At line 10 of file bug.f90
Fortran runtime error: End of record
I see this behaviour with both 4.1 and mainline. (With 4.0 I get a
segmentation fault at runtime instead.)
--
Summary: Runtime error on write to string of global variable
length
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: eedelman at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25628