public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "vivekrao4 at yahoo dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/31270]  New: print subscript value and array bounds when out-of-bounds error occurs
Date: Mon, 19 Mar 2007 22:02:00 -0000	[thread overview]
Message-ID: <bug-31270-9647@http.gcc.gnu.org/bugzilla/> (raw)

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


             reply	other threads:[~2007-03-19 22:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-19 22:02 vivekrao4 at yahoo dot com [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-31270-9647@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).