This bug seems not to have been reported yet. It is the cause of failure for the
NIST FM411 fortran test. The reduced test case is:
--------------------------------------------
program test
implicit none
integer i
endfile(8)
rewind(8)
read(8,end=0023) i
print *, i
stop
0023 print *, 'End of file'
stop
end
--------------------------------------------
The correct behaviour is:
$ g77 test.f; ./a.out
End of file
while gfortran currently doesn't handle it:
$ gfortran test.f; ./a.out
At line 7 of file test.f
Fortran runtime error: Corrupt unformatted sequential file
[This was tested on i686/linux with gcc version 4.0.0 20041202]
--
Summary: ENDFILE is not functionnal
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: coudert at clipper dot ens dot fr
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18778