public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/34599] New: Order: IOSTAT is wrongly set before data is transferred
@ 2007-12-27 15:24 burnus at gcc dot gnu dot org
2007-12-27 16:20 ` [Bug fortran/34599] IOSTAT variable in data transfer input/output list tkoenig at gcc dot gnu dot org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-12-27 15:24 UTC (permalink / raw)
To: gcc-bugs
This program is based on a failing test of the Unicomp Fortran 95 test suite;
while not all tests are correct (I found one which is listed as invalid code in
the Fortran 2003 standard, which fails in gfortran), I think the following is
valid. The problem is that gfortran sets the variable "is" to zero before it
transfers the data.
In "9.5.3 Execution of a data transfer input/output statement" one finds:
"[...]
(6) Transfer data between the file and the entities specified by the
input/output list (if any) or namelist.
(7) Determine whether an error, end-of-file, or end-of-record condition has
occurred."
The following program works with f95, ifort, sunf95 and openf95; it fails with
gfortran and g95.
program io_test
implicit none
integer :: is
character(len=20) :: str
is = 99
write (str, fmt=*, iostat=is) is
print *, is
print *, str
if (is /= 0) stop 'FAIL 1'
if (adjustl(str) /= '99') stop 'FAIL 2'
end program io_test
--
Summary: Order: IOSTAT is wrongly set before data is transferred
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: burnus at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34599
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug fortran/34599] IOSTAT variable in data transfer input/output list
2007-12-27 15:24 [Bug fortran/34599] New: Order: IOSTAT is wrongly set before data is transferred burnus at gcc dot gnu dot org
@ 2007-12-27 16:20 ` tkoenig at gcc dot gnu dot org
2007-12-27 19:15 ` burnus at gcc dot gnu dot org
2010-05-01 20:44 ` dfranke at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-12-27 16:20 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from tkoenig at gcc dot gnu dot org 2007-12-27 16:20 -------
This is invalid (but we could catch it, as an enhancement).
>From the F95 draft, 9.4.1:
In a data transfer statement, the variable specified in an IOSTAT= or a SIZE=
specifier, if any, shall
not be associated with any entity in the data transfer input/output list
(9.4.2) or
namelist-group-object-list, nor with a do-variable of an io-implied-do in the
data transfer input/output list.
--
tkoenig at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Keywords| |diagnostic
Last reconfirmed|0000-00-00 00:00:00 |2007-12-27 16:20:25
date| |
Summary|Order: IOSTAT is wrongly set|IOSTAT variable in data
|before data is transferred |transfer input/output list
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34599
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug fortran/34599] IOSTAT variable in data transfer input/output list
2007-12-27 15:24 [Bug fortran/34599] New: Order: IOSTAT is wrongly set before data is transferred burnus at gcc dot gnu dot org
2007-12-27 16:20 ` [Bug fortran/34599] IOSTAT variable in data transfer input/output list tkoenig at gcc dot gnu dot org
@ 2007-12-27 19:15 ` burnus at gcc dot gnu dot org
2010-05-01 20:44 ` dfranke at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-12-27 19:15 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from burnus at gcc dot gnu dot org 2007-12-27 19:14 -------
> This is invalid (but we could catch it, as an enhancement).
I somehow missed that clause. I think one can thus close this bug. The test
suite seems to have more bugs than I hoped.
(Though, having it fixed has the advantage that the Unicomp test suite passes
;-)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34599
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug fortran/34599] IOSTAT variable in data transfer input/output list
2007-12-27 15:24 [Bug fortran/34599] New: Order: IOSTAT is wrongly set before data is transferred burnus at gcc dot gnu dot org
2007-12-27 16:20 ` [Bug fortran/34599] IOSTAT variable in data transfer input/output list tkoenig at gcc dot gnu dot org
2007-12-27 19:15 ` burnus at gcc dot gnu dot org
@ 2010-05-01 20:44 ` dfranke at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2010-05-01 20:44 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from dfranke at gcc dot gnu dot org 2010-05-01 20:44 -------
(In reply to comment #2)
> I somehow missed that clause. I think one can thus close this bug.
Finally doing so. Please re-open if new information was obtained in the
meantime.
--
dfranke at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dfranke at gcc dot gnu dot
| |org
Status|NEW |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34599
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-05-01 20:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-27 15:24 [Bug fortran/34599] New: Order: IOSTAT is wrongly set before data is transferred burnus at gcc dot gnu dot org
2007-12-27 16:20 ` [Bug fortran/34599] IOSTAT variable in data transfer input/output list tkoenig at gcc dot gnu dot org
2007-12-27 19:15 ` burnus at gcc dot gnu dot org
2010-05-01 20:44 ` dfranke 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).