public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/31270]  New: print subscript value and array bounds when out-of-bounds error occurs
@ 2007-03-19 22:02 vivekrao4 at yahoo dot com
  2007-03-23 21:32 ` [Bug fortran/31270] " fxcoudert at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: vivekrao4 at yahoo dot com @ 2007-03-19 22:02 UTC (permalink / raw)
  To: gcc-bugs

For the code

program xcheck
implicit none
integer :: i,ivec(2)
ivec = 0
do i=1,3
   if (i**2 < 10) print*,ivec(i)
end do
end program xcheck

gfortran -Wall -fbounds-check

for mingw 4.3.0 20070315

gives at run time

Fortran runtime error: Array reference out of bounds for array 'ivec', upper
bound of dimension 1 exceeded (in file 'xbounds_check.f90', at line 6)
           0
           0

This is good, but g95 is a little more informative, identifyng the value of the
out-of-bound subscript and the relevant dimension of the array, saying

 0
 0
At line 6 of file xbounds_check.f90 (Unit 6)
Traceback: not available, compile with -ftrace=frame or -ftrace=full
Fortran runtime error: Array element out of bounds: 3 in (1:2), dim=1

Vivek Rao


-- 
           Summary: print subscript value and array bounds when out-of-
                    bounds error occurs
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: vivekrao4 at yahoo dot com


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


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

end of thread, other threads:[~2007-08-10 22:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-19 22:02 [Bug fortran/31270] New: print subscript value and array bounds when out-of-bounds error occurs vivekrao4 at yahoo dot com
2007-03-23 21:32 ` [Bug fortran/31270] " fxcoudert at gcc dot gnu dot org
2007-08-05 13:42 ` fxcoudert at gcc dot gnu dot org
2007-08-05 14:06 ` fxcoudert at gcc dot gnu dot org
2007-08-10 22:12 ` fxcoudert at gcc dot gnu dot org
2007-08-10 22:13 ` fxcoudert at gcc dot gnu dot org

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).