This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug debug/26509] New: incorrect behaviour of error-handler for internal read
- From: "kloedej at knmi dot nl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Mar 2006 12:36:20 -0000
- Subject: [Bug debug/26509] New: incorrect behaviour of error-handler for internal read
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
dear people,
the following test code gives some unexpected results:
program dummy
character(len=100) :: a
integer :: i,ios
i=777
a(:) = ' '
read(a,*,err=999) i
print *,"i=",i
i=666
read(a,*,iostat=ios) i
print *,"i=",i
IF (ios .ne. 0) print *,"read error: ios=",ios
stop
999 print *,"read error occurred"
end program dummy
The test program should jump to label 999 as soon as the first read statement
fails. (or is this not part of the standard? seems unlikely, but I am no expert
on that).
However, the program stops with a runtime error.
The iostat error handler in the next read statement by the way does work
correct.
My screen output is:
>gfortran -o dummy dummy.F90
>dummy
At line 7 of file dummy.F90
Fortran runtime error: End of file
>
The gfortran version used for testing was:
>gfortran -v
Using built-in specs.
Target: i386-linux
Configured with: ../gcc/configure
--prefix=/cosmic/coudert/tmp/gfortran-20060301/irun
--enable-languages=c,fortran --host=i386-linux
--with-gmp=/cosmic/coudert/tmp/gfortran-20060301/gfortran_libs
Thread model: posix
gcc version 4.2.0 20060228 (experimental)
>
best regards,
Jos de Kloe
--
Summary: incorrect behaviour of error-handler for internal read
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: debug
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: kloedej at knmi dot nl
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26509