public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/52788] New: -fbounds-check fails for 2-rank allocatable arrays when reading
@ 2012-03-30  7:12 Edouard.Canot at irisa dot fr
  2012-03-30  7:18 ` [Bug fortran/52788] " Edouard.Canot at irisa dot fr
  2013-06-15 13:08 ` dominiq at lps dot ens.fr
  0 siblings, 2 replies; 3+ messages in thread
From: Edouard.Canot at irisa dot fr @ 2012-03-30  7:12 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug fortran/52788] -fbounds-check fails for 2-rank allocatable arrays when reading
  2012-03-30  7:12 [Bug fortran/52788] New: -fbounds-check fails for 2-rank allocatable arrays when reading Edouard.Canot at irisa dot fr
@ 2012-03-30  7:18 ` Edouard.Canot at irisa dot fr
  2013-06-15 13:08 ` dominiq at lps dot ens.fr
  1 sibling, 0 replies; 3+ messages in thread
From: Edouard.Canot at irisa dot fr @ 2012-03-30  7:18 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52788

--- Comment #1 from Edouard.Canot at irisa dot fr 2012-03-30 07:11:41 UTC ---
For a one dimensional allocatable array, gfortran leads to a correct behavior
when reading, i.e. it detects the bounds overflow.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug fortran/52788] -fbounds-check fails for 2-rank allocatable arrays when reading
  2012-03-30  7:12 [Bug fortran/52788] New: -fbounds-check fails for 2-rank allocatable arrays when reading Edouard.Canot at irisa dot fr
  2012-03-30  7:18 ` [Bug fortran/52788] " Edouard.Canot at irisa dot fr
@ 2013-06-15 13:08 ` dominiq at lps dot ens.fr
  1 sibling, 0 replies; 3+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-06-15 13:08 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52788

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-06-15
     Ever confirmed|0                           |1

--- Comment #2 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Still present at revision 200122.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-06-15 13:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-30  7:12 [Bug fortran/52788] New: -fbounds-check fails for 2-rank allocatable arrays when reading Edouard.Canot at irisa dot fr
2012-03-30  7:18 ` [Bug fortran/52788] " Edouard.Canot at irisa dot fr
2013-06-15 13:08 ` dominiq at lps dot ens.fr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).