This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] fix PR libfortran/23321
- From: Paul Thomas <paulthomas2 at wanadoo dot fr>
- To: Thomas Koenig <Thomas dot Koenig at online dot de>
- Cc: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Thu, 18 Aug 2005 12:26:43 +0200
- Subject: Re: [patch] fix PR libfortran/23321
- References: <20050816200240.GA1387@meiner.onlinehome.de>
Thomas,
The patch looks OK. However, I have a problem with the test-case: Unless
the print statement is present, it aborts at the next statement. I
cannot, at the moment, see what the problem is.
GNU F95 version 4.1.0 20050813 (experimental) (i686-pc-linux-gnu)
compiled by GNU C version 3.4.2 20041017 (Red Hat 3.4.2-6.fc3).
! { dg-do run }
! PR 23321 : Running off the end of a file was not detected with direct I/O.
program main
implicit none
integer(kind=1) :: a, b
integer :: ios, i
a = 42
b = 1
open (unit=10,status="scratch",recl=1,access="direct")
write(10,rec=1) a
read (10,rec=2, iostat=ios) b
if (ios == 0) call abort
read (10, rec=82641, iostat=ios) b ! This used to cause a segfault
print *, a, b, ios ! THIS IS NECESSARY TO PREVENT
ABORT
if (ios == 0) call abort
read(10, rec=1, iostat=ios) b
if (ios /= 0) call abort
if (a /= b) call abort
end program main
Regards
Paul T