This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/52788] New: -fbounds-check fails for 2-rank allocatable arrays when reading
- From: "Edouard.Canot at irisa dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 30 Mar 2012 06:57:27 +0000
- Subject: [Bug fortran/52788] New: -fbounds-check fails for 2-rank allocatable arrays when reading
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52788
Bug #: 52788
Summary: -fbounds-check fails for 2-rank allocatable arrays
when reading
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: Edouard.Canot@irisa.fr
For the following code:
================================
program test1
implicit none
double precision, allocatable :: C(:,:)
integer :: i
allocate( C(3,2) )
open(10,file='C.dat')
do i = 1, 4
read(10,*) C(i,:) ! fbounds-check doesn't work
end do
close(10)
end program
================================
gfortran doesn't catch at run-time the last data read using the first dimension
i=4
The data file 'C.dat' is not important, I have used:
$ cat C.dat
1.0 -1.0
2.0 -2.0
3.0 -3.0
4.0 -4.0
but it can contains any numerical data spread over two columns.
---
The previous code has been compiled with:
$ gfortran -fbounds-check -o test1 test1.f90
The failure occurs at least for the following version of gcc:
4.3.6, 4.4.7, 4.5.3, 4.6.3, 4.7.0
i.e. all known versions from 4.3