public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/34411] New: hang-up during read of non-expected input
@ 2007-12-09 19:59 hroch at physics dot muni dot cz
2007-12-09 21:03 ` [Bug fortran/34411] " burnus at gcc dot gnu dot org
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: hroch at physics dot muni dot cz @ 2007-12-09 19:59 UTC (permalink / raw)
To: gcc-bugs
I gets hang-up of the fragment of code during execution:
program zk
real :: x,y
do
read(*,'(T7,2F9.3)',iostat=ii,end=666) x,y
if( iostat == 0 ) write(*,*) x,y
end do
666 continue
end program zk
with this data on input:
NL NX NY LOWBAD HIGHBAD THRESH AP1 PH/ADU RNOISE
2 765 510 1.26E+3 6.50E+4 156.96 2.00 2.30 15.00
289 329.142 214.107 12.313 12.050 11.913 11.868 11.834 11.722
2038.497 99.99 0.00 0.019 0.021 0.025 0.034 0.045 0.055
413 360.334 245.261 12.375 11.910 11.469 11.086 10.719 10.327
2596.395 99.99 0.00 0.019 0.017 0.016 0.015 0.015 0.014
655 332.704 317.964 12.523 12.212 11.998 11.892 11.819 11.711
1627.586 99.99 0.00 0.005 0.005 0.006 0.007 0.009 0.011
360 379.769 231.226 12.709 12.422 12.195 11.941 11.644 11.324
2561.539 99.99 0.00 0.042 0.043 0.050 0.055 0.057 0.057
------
The reason of this is read only lines with float numbers on appropriate
positions. For example, the first line to read is '289 329.142 214.107...'.
The hang-up has been verified under various recent linux distributions (Ubuntu,
Gentoo (gcc version 4.1.2), ... ), architectures (amd64, i686) and under last
night-build (gcc version 4.3.0 20071209 (experimental) [trunk revision 130717]
(GCC)).
The code is correctly compiled without any warnings as 'gfortran -Wall zk.f90'.
The fragment of the code comes from my long-term project Munipack and has been
verified by a lot of f90 and f77 compilers and it doesn't violate any fortran
norm (in my oppinion). The hang-up doesn't not appear with original g95
project, but only with the new gfortran project at least year ago.
--
Summary: hang-up during read of non-expected input
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hroch at physics dot muni dot cz
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34411
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/34411] hang-up during read of non-expected input
2007-12-09 19:59 [Bug fortran/34411] New: hang-up during read of non-expected input hroch at physics dot muni dot cz
@ 2007-12-09 21:03 ` burnus at gcc dot gnu dot org
2007-12-09 22:31 ` jvdelisle at gcc dot gnu dot org
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-12-09 21:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from burnus at gcc dot gnu dot org 2007-12-09 21:03 -------
Do you have an idea, Jerry? I can reproduce it with gfortran 4.1.3, 4.2.2 and
4.3.0 and as he writes, other compilers (NAG f95, g95, ifort) work.
(Note: One needs to change "ii" into "iostat" or vice versa.)
gfortran does not print anything and hangs, with other compilers, the output
is:
0. 0.
329.142 214.107
0. 0.
360.334 245.261
0. 0.
332.704 317.964
0. 0.
379.769 231.226
0. 0.
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jvdelisle at gcc dot gnu dot
| |org, burnus at gcc dot gnu
| |dot org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-12-09 21:03:10
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34411
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/34411] hang-up during read of non-expected input
2007-12-09 19:59 [Bug fortran/34411] New: hang-up during read of non-expected input hroch at physics dot muni dot cz
2007-12-09 21:03 ` [Bug fortran/34411] " burnus at gcc dot gnu dot org
@ 2007-12-09 22:31 ` jvdelisle at gcc dot gnu dot org
2007-12-10 2:16 ` jvdelisle at gcc dot gnu dot org
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-12-09 22:31 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from jvdelisle at gcc dot gnu dot org 2007-12-09 22:31 -------
I will investigate this one.
--
jvdelisle at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |jvdelisle at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
Last reconfirmed|2007-12-09 21:03:10 |2007-12-09 22:31:33
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34411
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/34411] hang-up during read of non-expected input
2007-12-09 19:59 [Bug fortran/34411] New: hang-up during read of non-expected input hroch at physics dot muni dot cz
2007-12-09 21:03 ` [Bug fortran/34411] " burnus at gcc dot gnu dot org
2007-12-09 22:31 ` jvdelisle at gcc dot gnu dot org
@ 2007-12-10 2:16 ` jvdelisle at gcc dot gnu dot org
2007-12-10 6:44 ` burnus at gcc dot gnu dot org
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-12-10 2:16 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from jvdelisle at gcc dot gnu dot org 2007-12-10 02:16 -------
First, you are relying on non-portable behavior:
F95 Standard 9.4.1.5 Error branch - subpart (2)->
"The position of the file specified in the input/output statement becomes
indeterminate"
So gfortran does not try to change the file position after the read and the
subsequent reads continue to read bad values and ad-infinitum. The loop is in
your program.
Second, as a Quality of Implementation issue, and under these conditions we can
do whatever we want, I have a patch testing that moves the file to the next
record position. :)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34411
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/34411] hang-up during read of non-expected input
2007-12-09 19:59 [Bug fortran/34411] New: hang-up during read of non-expected input hroch at physics dot muni dot cz
` (2 preceding siblings ...)
2007-12-10 2:16 ` jvdelisle at gcc dot gnu dot org
@ 2007-12-10 6:44 ` burnus at gcc dot gnu dot org
2007-12-10 19:49 ` dominiq at lps dot ens dot fr
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-12-10 6:44 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from burnus at gcc dot gnu dot org 2007-12-10 06:43 -------
Patch:
http://gcc.gnu.org/ml/gcc-patches/2007-12/msg00433.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34411
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/34411] hang-up during read of non-expected input
2007-12-09 19:59 [Bug fortran/34411] New: hang-up during read of non-expected input hroch at physics dot muni dot cz
` (3 preceding siblings ...)
2007-12-10 6:44 ` burnus at gcc dot gnu dot org
@ 2007-12-10 19:49 ` dominiq at lps dot ens dot fr
2007-12-11 3:50 ` jvdelisle at gcc dot gnu dot org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: dominiq at lps dot ens dot fr @ 2007-12-10 19:49 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from dominiq at lps dot ens dot fr 2007-12-10 19:49 -------
Patch of comment #4 works as advertised without regression at -m32 and -m64
for ppc-Darwin9 and Intel-Darwin8/9.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34411
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/34411] hang-up during read of non-expected input
2007-12-09 19:59 [Bug fortran/34411] New: hang-up during read of non-expected input hroch at physics dot muni dot cz
` (4 preceding siblings ...)
2007-12-10 19:49 ` dominiq at lps dot ens dot fr
@ 2007-12-11 3:50 ` jvdelisle at gcc dot gnu dot org
2007-12-11 3:56 ` jvdelisle at gcc dot gnu dot org
2007-12-14 19:26 ` jvdelisle at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-12-11 3:50 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from jvdelisle at gcc dot gnu dot org 2007-12-11 03:50 -------
Subject: Bug 34411
Author: jvdelisle
Date: Tue Dec 11 03:49:52 2007
New Revision: 130767
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=130767
Log:
2007-12-10 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/34411
* io/read.c (convert_real, read_l, read_decimal, read_radix, read_f):
Call next_record after bad read or overflow error.
Modified:
trunk/libgfortran/ChangeLog
trunk/libgfortran/io/read.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34411
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/34411] hang-up during read of non-expected input
2007-12-09 19:59 [Bug fortran/34411] New: hang-up during read of non-expected input hroch at physics dot muni dot cz
` (5 preceding siblings ...)
2007-12-11 3:50 ` jvdelisle at gcc dot gnu dot org
@ 2007-12-11 3:56 ` jvdelisle at gcc dot gnu dot org
2007-12-14 19:26 ` jvdelisle at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-12-11 3:56 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from jvdelisle at gcc dot gnu dot org 2007-12-11 03:56 -------
Subject: Bug 34411
Author: jvdelisle
Date: Tue Dec 11 03:56:05 2007
New Revision: 130768
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=130768
Log:
2007-12-10 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/34411
* gfortran.dg/error_recovery_5.f90: New.
* gfortran.dg/optional_dim_2.f90: Fix test, not related to this PR.
Added:
trunk/gcc/testsuite/gfortran.dg/error_recovery_5.f90
Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/optional_dim_2.f90
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34411
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/34411] hang-up during read of non-expected input
2007-12-09 19:59 [Bug fortran/34411] New: hang-up during read of non-expected input hroch at physics dot muni dot cz
` (6 preceding siblings ...)
2007-12-11 3:56 ` jvdelisle at gcc dot gnu dot org
@ 2007-12-14 19:26 ` jvdelisle at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-12-14 19:26 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from jvdelisle at gcc dot gnu dot org 2007-12-14 19:25 -------
Fixed on trunk.
--
jvdelisle at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34411
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2007-12-14 19:26 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-09 19:59 [Bug fortran/34411] New: hang-up during read of non-expected input hroch at physics dot muni dot cz
2007-12-09 21:03 ` [Bug fortran/34411] " burnus at gcc dot gnu dot org
2007-12-09 22:31 ` jvdelisle at gcc dot gnu dot org
2007-12-10 2:16 ` jvdelisle at gcc dot gnu dot org
2007-12-10 6:44 ` burnus at gcc dot gnu dot org
2007-12-10 19:49 ` dominiq at lps dot ens dot fr
2007-12-11 3:50 ` jvdelisle at gcc dot gnu dot org
2007-12-11 3:56 ` jvdelisle at gcc dot gnu dot org
2007-12-14 19:26 ` jvdelisle 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).