[Bug fortran/31278] Backtrace/coredump for array-out-of-bounds errors (-fbounds-check)
fxcoudert at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Sat Mar 24 12:13:00 GMT 2007
------- 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
More information about the Gcc-bugs
mailing list