This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/34594] New: On error, no jump to ERR=<label>
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Dec 2007 15:09:33 -0000
- Subject: [Bug fortran/34594] New: On error, no jump to ERR=<label>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
For the following program, the IOSTAT is properly set to /= 0 (namely to -1),
but the ERR= is ignored. If iostat= is not present, a run-time error is shown,
otherwise after the read statement is continued as if nothing had happened.
My test case, based on e73 test case of the Fortran 95 testsuite.
implicit none
integer :: iou, i, ir, TEMP_CHANGES
iou=9
i=44
ir = -42
open(iou,access="direct",recl=1000,status="scratch")
! Variant 1: Gives run-time error instead of jumping to 99
!READ (11, REC = I, ERR = 99) TEMP_CHANGES
! Variant 2: ir is ok, but does not jump to 99
READ (11, REC = I, IOSTAT = IR, ERR = 99) TEMP_CHANGES
print *, 'Should not be reached; ir = ', ir
stop
99 continue
if(ir == 0) then
print *,'ERROR: ir should not be 0'
stop
end if
print *, 'OK'
end
--
Summary: On error, no jump to ERR=<label>
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: burnus at gcc dot gnu dot org
OtherBugsDependingO 32834
nThis:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34594