This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/31278] Backtrace/coredump for array-out-of-bounds errors (-fbounds-check)
- From: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Mar 2007 12:13:17 -0000
- Subject: [Bug fortran/31278] Backtrace/coredump for array-out-of-bounds errors (-fbounds-check)
- References: <bug-31278-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from fxcoudert at gcc dot gnu dot org 2007-03-24 12:13 -------
We already have that, if you compile with both -fbounds-check and -fbacktrace.
(Same thing is true for coredump, with -fdump-core.) Do you want fries with
that?
$ cat bbb.f90
subroutine f
integer :: x(2), u
u = 3
x(u) = 0
end subroutine f
call f
end
$ gfortran -static bbb.f90 -fbounds-check -fbacktrace -g && ./a.out
Fortran runtime error: Array reference out of bounds for array 'x', upper bound
of dimension 1 exceeded (in file 'bbb.f90', at line 4)
Backtrace for this error:
+ function f_ (0x8048229)
at line 4 of file bbb.f90
+ in the main program
at line 7 of file bbb.f90
+ function __libc_start_main (0x805C9F9)
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31278