This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/24489] New: read_block wrong execution order
- From: "jvdelisle at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Oct 2005 22:54:30 -0000
- Subject: [Bug libfortran/24489] New: read_block wrong execution order
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following test case reads past the end of record because sf_read is being
executed before the check for length is performed. Discovered during testing
of arrayio. See message: http://gcc.gnu.org/ml/fortran/2005-10/msg00382.html
The following simplified test case shows the problem without using my arrayio
patches not yet committed.
program read_block
character*4, dimension(8) :: abuf = (/"0123","4567","89AB","CDEF", &
"0123","4567","89AB","CDEF"/)
character*4, dimension(2,4) :: buf
character*8 :: a
equivalence (buf,abuf)
read(buf, '(a8)') a
print *, a
end program read_block
gfortran gives:
$ ./a.out
01234567
ifort gives:
$ ./a.out
0123
--
Summary: read_block wrong execution order
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libfortran
AssignedTo: jvdelisle at gcc dot gnu dot org
ReportedBy: jvdelisle at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24489