public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/18398] New: Formatted I/O problems
@ 2004-11-09 14:01 sfilippone at uniroma2 dot it
2004-11-09 14:03 ` [Bug libfortran/18398] " sfilippone at uniroma2 dot it
` (10 more replies)
0 siblings, 11 replies; 12+ messages in thread
From: sfilippone at uniroma2 dot it @ 2004-11-09 14:01 UTC (permalink / raw)
To: gcc-bugs
The attached test case ought to exactly reproduce its input, and it does not on
two counts: 1. There are missing lines in the output 2. It gives a run time error.
The runtime error appears similar to that of bug 17597, but this is on formatted
I/O. If the source is compiled with g77 it produces correct output.
[sfilippo@localhost BOWL]$ gfortran -v
Reading specs from /home/local/gfortran/bin/../lib/gcc/i686-pc-linux-gnu/4.0.0/specs
Configured with: ../gcc-4.0-20041107/configure --prefix=/usr/local/gfortran
Thread model: posix
gcc version 4.0.0 20041107 (experimental)
[sfilippo@localhost BOWL]$ g77 -o rnp77 rnp.f
[sfilippo@localhost BOWL]$ gfortran -o rnp rnp.f
[sfilippo@localhost BOWL]$ ./rnp77 <itr >r77
[sfilippo@localhost BOWL]$ ./rnp <itr >rout
At line 47 of file rnp.f
Fortran runtime error: End of file
[sfilippo@localhost BOWL]$ diff rout r77
7a8
> cafilm 0.0000
9a11
> pgssw 0.0000
12a15
> dtmax 0.31100E-04
16a20
> bore 8.2000
20a25
> datdct 0.0000
22a28
> swipro 3.1100
23a30
> sector 0.0000
..... etc
--
Summary: Formatted I/O problems
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libfortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sfilippone at uniroma2 dot it
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18398
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libfortran/18398] Formatted I/O problems
2004-11-09 14:01 [Bug libfortran/18398] New: Formatted I/O problems sfilippone at uniroma2 dot it
@ 2004-11-09 14:03 ` sfilippone at uniroma2 dot it
2004-11-09 14:03 ` sfilippone at uniroma2 dot it
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: sfilippone at uniroma2 dot it @ 2004-11-09 14:03 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From sfilippone at uniroma2 dot it 2004-11-09 14:03 -------
Created an attachment (id=7501)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7501&action=view)
test case input file
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18398
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libfortran/18398] Formatted I/O problems
2004-11-09 14:01 [Bug libfortran/18398] New: Formatted I/O problems sfilippone at uniroma2 dot it
2004-11-09 14:03 ` [Bug libfortran/18398] " sfilippone at uniroma2 dot it
@ 2004-11-09 14:03 ` sfilippone at uniroma2 dot it
2004-11-26 14:34 ` bdavis at gcc dot gnu dot org
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: sfilippone at uniroma2 dot it @ 2004-11-09 14:03 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From sfilippone at uniroma2 dot it 2004-11-09 14:02 -------
Created an attachment (id=7500)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7500&action=view)
Test case source code
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18398
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libfortran/18398] Formatted I/O problems
2004-11-09 14:01 [Bug libfortran/18398] New: Formatted I/O problems sfilippone at uniroma2 dot it
2004-11-09 14:03 ` [Bug libfortran/18398] " sfilippone at uniroma2 dot it
2004-11-09 14:03 ` sfilippone at uniroma2 dot it
@ 2004-11-26 14:34 ` bdavis at gcc dot gnu dot org
2004-11-27 15:34 ` bdavis at gcc dot gnu dot org
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: bdavis at gcc dot gnu dot org @ 2004-11-26 14:34 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2004-11-26 14:34:00
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18398
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libfortran/18398] Formatted I/O problems
2004-11-09 14:01 [Bug libfortran/18398] New: Formatted I/O problems sfilippone at uniroma2 dot it
` (2 preceding siblings ...)
2004-11-26 14:34 ` bdavis at gcc dot gnu dot org
@ 2004-11-27 15:34 ` bdavis at gcc dot gnu dot org
2005-01-04 22:20 ` Thomas dot Koenig at online dot de
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: bdavis at gcc dot gnu dot org @ 2004-11-27 15:34 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bdavis at gcc dot gnu dot org 2004-11-27 15:33 -------
here's a shorter test case:
program rinput
implicit double precision(a-h,o-z)
character *8 a,b
open(unit=7)
write(7,*)'aaaaaaa123.456'
write(7,*)'bbbbbbb-123.456'
write(7,*)
rewind(7)
610 format(a8,f10.5)
read (7,610) a,cafin ,b,angmom
print*, a,cafin ,b,angmom
stop
end
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18398
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libfortran/18398] Formatted I/O problems
2004-11-09 14:01 [Bug libfortran/18398] New: Formatted I/O problems sfilippone at uniroma2 dot it
` (3 preceding siblings ...)
2004-11-27 15:34 ` bdavis at gcc dot gnu dot org
@ 2005-01-04 22:20 ` Thomas dot Koenig at online dot de
2005-01-04 22:31 ` Thomas dot Koenig at online dot de
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Thomas dot Koenig at online dot de @ 2005-01-04 22:20 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From Thomas dot Koenig at online dot de 2005-01-04 22:20 -------
Even shorter testcase:
$ cat fio.f
open(7)
write (7,'(F12.5)') 1.0, 2.0, 3.0
rewind(7)
read(7,'(F15.5)') a,b
print *,a,b
if (abs(a-1.0) .gt. 1e-5) call abort
if (abs(b-2.0) .gt. 1e-5) call abort
end
$ gfortran fio.f && ./a.out
1.000000 3.000000
$ gfortran -dumpmachine
i686-pc-linux-gnu
Aborted
$ gfortran -v
Using built-in specs.
Configured with: ../gcc/configure --prefix=/home/ig25 --enable-languages=c,c++,f95
Thread model: posix
gcc version 4.0.0 20050103 (experimental)
Here's what should happen:
$ g77 fio.f && ./a.out
1. 2.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18398
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libfortran/18398] Formatted I/O problems
2004-11-09 14:01 [Bug libfortran/18398] New: Formatted I/O problems sfilippone at uniroma2 dot it
` (4 preceding siblings ...)
2005-01-04 22:20 ` Thomas dot Koenig at online dot de
@ 2005-01-04 22:31 ` Thomas dot Koenig at online dot de
2005-01-05 8:34 ` Thomas dot Koenig at online dot de
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Thomas dot Koenig at online dot de @ 2005-01-04 22:31 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From Thomas dot Koenig at online dot de 2005-01-04 22:31 -------
> $ gfortran fio.f && ./a.out
> 1.000000 3.000000
> $ gfortran -dumpmachine
> i686-pc-linux-gnu
> Aborted
I had mixed up my cut&paste there... of course,
it was the test program that aborted, not the
gfortran -dumpmachine command.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18398
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libfortran/18398] Formatted I/O problems
2004-11-09 14:01 [Bug libfortran/18398] New: Formatted I/O problems sfilippone at uniroma2 dot it
` (5 preceding siblings ...)
2005-01-04 22:31 ` Thomas dot Koenig at online dot de
@ 2005-01-05 8:34 ` Thomas dot Koenig at online dot de
2005-01-06 6:13 ` bdavis at gcc dot gnu dot org
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Thomas dot Koenig at online dot de @ 2005-01-05 8:34 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From Thomas dot Koenig at online dot de 2005-01-05 08:33 -------
A testcase with character variables:
$ gfortran cline
$ cat cline.f
character*2 c1,c2
open(7)
write (7,'(A1)') 'a','b','c'
rewind(7)
read(7,'(A2)') c1,c2
print *,c1,c2
if (c2 .ne. 'b ') call abort
end
$ gfortran cline.f
$ ./a.out
a c
Aborted
$ g77 cline.f
$ ./a.out
a b
I think this bug can be summed up as:
"Input Format longer than line length causes following record to be skipped".
This bug may be the reason for the I/O related LAPACK failures.
In the driver programs, for example cchkaa.f at line 314, there's the line
READ( NIN, FMT = '(A72)', END = 140 )ALINE
If the input line in question is shorter than 72 characters, this bug
will cause the next line to be skipped, with - presumably - bad consequences.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |Thomas dot Koenig at online
| |dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18398
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libfortran/18398] Formatted I/O problems
2004-11-09 14:01 [Bug libfortran/18398] New: Formatted I/O problems sfilippone at uniroma2 dot it
` (6 preceding siblings ...)
2005-01-05 8:34 ` Thomas dot Koenig at online dot de
@ 2005-01-06 6:13 ` bdavis at gcc dot gnu dot org
2005-01-06 14:41 ` tobi at gcc dot gnu dot org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: bdavis at gcc dot gnu dot org @ 2005-01-06 6:13 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bdavis at gcc dot gnu dot org 2005-01-06 06:13 -------
patch here:
http://gcc.gnu.org/ml/fortran/2005-01/msg00038.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18398
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libfortran/18398] Formatted I/O problems
2004-11-09 14:01 [Bug libfortran/18398] New: Formatted I/O problems sfilippone at uniroma2 dot it
` (7 preceding siblings ...)
2005-01-06 6:13 ` bdavis at gcc dot gnu dot org
@ 2005-01-06 14:41 ` tobi at gcc dot gnu dot org
2005-01-07 3:25 ` cvs-commit at gcc dot gnu dot org
2005-01-07 14:01 ` pinskia at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: tobi at gcc dot gnu dot org @ 2005-01-06 14:41 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
OtherBugsDependingO| |19292
nThis| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18398
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libfortran/18398] Formatted I/O problems
2004-11-09 14:01 [Bug libfortran/18398] New: Formatted I/O problems sfilippone at uniroma2 dot it
` (8 preceding siblings ...)
2005-01-06 14:41 ` tobi at gcc dot gnu dot org
@ 2005-01-07 3:25 ` cvs-commit at gcc dot gnu dot org
2005-01-07 14:01 ` pinskia at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-01-07 3:25 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-01-07 03:25 -------
Subject: Bug 18398
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: bdavis@gcc.gnu.org 2005-01-07 03:25:48
Modified files:
gcc/testsuite : ChangeLog
libgfortran : ChangeLog
libgfortran/io : transfer.c
Added files:
gcc/testsuite/gfortran.dg: fmt_read.f90
Log message:
2005-01-07 Bud Davis <bdavis9659@comcast.net>
PR fortran/18398
* transfer.c (next_record_r): always skip the
eol search if it was found during sf_read.
* gfortran.dg/fmt_read.f90: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/fmt_read.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4858&r2=1.4859
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/ChangeLog.diff?cvsroot=gcc&r1=1.143&r2=1.144
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/io/transfer.c.diff?cvsroot=gcc&r1=1.23&r2=1.24
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18398
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libfortran/18398] Formatted I/O problems
2004-11-09 14:01 [Bug libfortran/18398] New: Formatted I/O problems sfilippone at uniroma2 dot it
` (9 preceding siblings ...)
2005-01-07 3:25 ` cvs-commit at gcc dot gnu dot org
@ 2005-01-07 14:01 ` pinskia at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-07 14:01 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-07 14:01 -------
Fixed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18398
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2005-01-07 14:01 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-09 14:01 [Bug libfortran/18398] New: Formatted I/O problems sfilippone at uniroma2 dot it
2004-11-09 14:03 ` [Bug libfortran/18398] " sfilippone at uniroma2 dot it
2004-11-09 14:03 ` sfilippone at uniroma2 dot it
2004-11-26 14:34 ` bdavis at gcc dot gnu dot org
2004-11-27 15:34 ` bdavis at gcc dot gnu dot org
2005-01-04 22:20 ` Thomas dot Koenig at online dot de
2005-01-04 22:31 ` Thomas dot Koenig at online dot de
2005-01-05 8:34 ` Thomas dot Koenig at online dot de
2005-01-06 6:13 ` bdavis at gcc dot gnu dot org
2005-01-06 14:41 ` tobi at gcc dot gnu dot org
2005-01-07 3:25 ` cvs-commit at gcc dot gnu dot org
2005-01-07 14:01 ` pinskia 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).