public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/25628] New: Runtime error on write to string of global variable length
@ 2006-01-01 18:48 eedelman at gcc dot gnu dot org
2006-01-01 19:07 ` [Bug libfortran/25628] " pinskia at gcc dot gnu dot org
2006-01-01 19:27 ` eedelman at gcc dot gnu dot org
0 siblings, 2 replies; 3+ messages in thread
From: eedelman at gcc dot gnu dot org @ 2006-01-01 18:48 UTC (permalink / raw)
To: gcc-bugs
$ 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug libfortran/25628] Runtime error on write to string of global variable length
2006-01-01 18:48 [Bug fortran/25628] New: Runtime error on write to string of global variable length eedelman at gcc dot gnu dot org
@ 2006-01-01 19:07 ` pinskia at gcc dot gnu dot org
2006-01-01 19:27 ` eedelman at gcc dot gnu dot org
1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-01 19:07 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2006-01-01 19:07 -------
Is this really a bug, changing the subroutine to:
subroutine bar()
character(len=10) :: str
write (str, *) 0
end subroutine bar
Also cause the problem, if I increase the size by a couple, it works.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|fortran |libfortran
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25628
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug libfortran/25628] Runtime error on write to string of global variable length
2006-01-01 18:48 [Bug fortran/25628] New: Runtime error on write to string of global variable length eedelman at gcc dot gnu dot org
2006-01-01 19:07 ` [Bug libfortran/25628] " pinskia at gcc dot gnu dot org
@ 2006-01-01 19:27 ` eedelman at gcc dot gnu dot org
1 sibling, 0 replies; 3+ messages in thread
From: eedelman at gcc dot gnu dot org @ 2006-01-01 19:27 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from eedelman at gcc dot gnu dot org 2006-01-01 19:27 -------
(In reply to comment #1)
> Is this really a bug, changing the subroutine to:
> subroutine bar()
> character(len=10) :: str
> write (str, *) 0
> end subroutine bar
>
> Also cause the problem, if I increase the size by a couple, it works.
>
I think you are right. Closing as "INVALID".
--
eedelman at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25628
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-01-01 19:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-01 18:48 [Bug fortran/25628] New: Runtime error on write to string of global variable length eedelman at gcc dot gnu dot org
2006-01-01 19:07 ` [Bug libfortran/25628] " pinskia at gcc dot gnu dot org
2006-01-01 19:27 ` eedelman at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).