* [Bug fortran/23375] show location for runtime errors
[not found] <bug-23375-10391@http.gcc.gnu.org/bugzilla/>
@ 2006-03-21 23:36 ` pinskia at gcc dot gnu dot org
2006-05-10 13:54 ` jjcogliati-r1 at yahoo dot com
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-03-21 23:36 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2006-03-21 23:36 -------
*** Bug 26791 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jjcogliati-r1 at yahoo dot
| |com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23375
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/23375] show location for runtime errors
[not found] <bug-23375-10391@http.gcc.gnu.org/bugzilla/>
2006-03-21 23:36 ` [Bug fortran/23375] show location for runtime errors pinskia at gcc dot gnu dot org
@ 2006-05-10 13:54 ` jjcogliati-r1 at yahoo dot com
2006-05-23 21:41 ` tkoenig at gcc dot gnu dot org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jjcogliati-r1 at yahoo dot com @ 2006-05-10 13:54 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from jjcogliati-r1 at yahoo dot com 2006-05-10 13:54 -------
(In reply to comment #1)
> Confirmed. Though sometimes I wonder if this is an over use of printf style
> debugging.
>
<rant>Well, I have a fortran program. It ran fine for the first 10 and a half
hours. Then it died with the error: "Fortran runtime error: Array reference
out of bounds" Any hints on debugging it?</rant>
The front end seems to support filenames and line numbers. bad_array.f90:
program bad_array
integer,dimension(8) :: array
array(9) = 123
array(10) = 321
end program bad_array
gfortran -fdump-tree-all -fbounds-check bad_array.f90
bad_array.f90.t02.original:
MAIN__ ()
{
int4 array[8];
_gfortran_set_std (86, 127, 0);
_gfortran_runtime_error ("Array reference out of bounds", "bad_array.f90",
1);
array[8] = 123;
_gfortran_runtime_error ("Array reference out of bounds", "bad_array.f90",
3);
array[9] = 321;
}
So in GCC 4.1.0, the only problem seems to be that _gfortran_runtime_error is
not printing the filename and the line number and the line number seems to be
the line number of the previous statement, not the one that errors.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23375
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/23375] show location for runtime errors
[not found] <bug-23375-10391@http.gcc.gnu.org/bugzilla/>
2006-03-21 23:36 ` [Bug fortran/23375] show location for runtime errors pinskia at gcc dot gnu dot org
2006-05-10 13:54 ` jjcogliati-r1 at yahoo dot com
@ 2006-05-23 21:41 ` tkoenig at gcc dot gnu dot org
2006-05-24 12:49 ` jjcogliati-r1 at yahoo dot com
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2006-05-23 21:41 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from tkoenig at gcc dot gnu dot org 2006-05-23 21:41 -------
(In reply to comment #3)
> So in GCC 4.1.0, the only problem seems to be that _gfortran_runtime_error is
> not printing the filename and the line number and the line number seems to be
> the line number of the previous statement, not the one that errors.
runtime_error is also called from lots of places from within libgfortran,
and there is currently no way to pass line number information to intrinsics.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23375
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/23375] show location for runtime errors
[not found] <bug-23375-10391@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2006-05-23 21:41 ` tkoenig at gcc dot gnu dot org
@ 2006-05-24 12:49 ` jjcogliati-r1 at yahoo dot com
2006-05-24 20:48 ` tkoenig at gcc dot gnu dot org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jjcogliati-r1 at yahoo dot com @ 2006-05-24 12:49 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from jjcogliati-r1 at yahoo dot com 2006-05-24 12:49 -------
(In reply to comment #4)
> (In reply to comment #3)
>
> > So in GCC 4.1.0, the only problem seems to be that _gfortran_runtime_error is
> > not printing the filename and the line number and the line number seems to be
> > the line number of the previous statement, not the one that errors.
>
> runtime_error is also called from lots of places from within libgfortran,
> and there is currently no way to pass line number information to intrinsics.
>
So, make a new function like runtime_error_with_lineinfo, and have that called
instead when there is line information. I believe that
gfor_fndecl_runtime_error declared in gcc-4.1.0/gcc/fortran/trans-decl.c is
only used by trans.c in gfc_trans_runtime_check which always has line number
information.
So, how to make a patch for this:
Create a runtime_error_with_loc in gcc-4.1.0/libgfortran/runtime/error.c that
uses the a line number and filename.
Change the gfor_fndecl_runtime_error to call runtime_error_with_loc instead of
runtime_error in gcc-4.1.0/gcc/fortran/trans-decl.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23375
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/23375] show location for runtime errors
[not found] <bug-23375-10391@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2006-05-24 12:49 ` jjcogliati-r1 at yahoo dot com
@ 2006-05-24 20:48 ` tkoenig at gcc dot gnu dot org
2006-06-01 21:50 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2006-05-24 20:48 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from tkoenig at gcc dot gnu dot org 2006-05-24 20:48 -------
(In reply to comment #5)
> So, how to make a patch for this:
> Create a runtime_error_with_loc in gcc-4.1.0/libgfortran/runtime/error.c that
> uses the a line number and filename.
>
> Change the gfor_fndecl_runtime_error to call runtime_error_with_loc instead of
> runtime_error in gcc-4.1.0/gcc/fortran/trans-decl.c
Looks doable. Correct line number information would be preferable, of
course (I currently have no idea why this goes wrong right now).
Do you already have a copyright assignment with the FSF? If so,
maybe you can prepare a patch. I promise speedy review :-)
Thomas
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23375
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/23375] show location for runtime errors
[not found] <bug-23375-10391@http.gcc.gnu.org/bugzilla/>
` (4 preceding siblings ...)
2006-05-24 20:48 ` tkoenig at gcc dot gnu dot org
@ 2006-06-01 21:50 ` pinskia at gcc dot gnu dot org
2006-06-07 9:42 ` fxcoudert at gcc dot gnu dot org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-06-01 21:50 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from pinskia at gcc dot gnu dot org 2006-06-01 21:50 -------
*** Bug 27868 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tobias dot burnus at physik
| |dot fu-berlin dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23375
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/23375] show location for runtime errors
[not found] <bug-23375-10391@http.gcc.gnu.org/bugzilla/>
` (5 preceding siblings ...)
2006-06-01 21:50 ` pinskia at gcc dot gnu dot org
@ 2006-06-07 9:42 ` fxcoudert at gcc dot gnu dot org
2006-09-20 11:58 ` tobias dot burnus at physik dot fu-berlin dot de
2006-09-28 7:59 ` fxcoudert at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2006-06-07 9:42 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from fxcoudert at gcc dot gnu dot org 2006-06-07 09:12 -------
I wasn't aware of the existence of this PR. I think the problem is a least
partly fixed by my recent patch. Are there other runtime errors where we don't
issue a source location?
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |fxcoudert at gcc dot gnu dot
| |org
Last reconfirmed|2006-01-29 19:53:05 |2006-06-07 09:12:14
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23375
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/23375] show location for runtime errors
[not found] <bug-23375-10391@http.gcc.gnu.org/bugzilla/>
` (6 preceding siblings ...)
2006-06-07 9:42 ` fxcoudert at gcc dot gnu dot org
@ 2006-09-20 11:58 ` tobias dot burnus at physik dot fu-berlin dot de
2006-09-28 7:59 ` fxcoudert at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: tobias dot burnus at physik dot fu-berlin dot de @ 2006-09-20 11:58 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from tobias dot burnus at physik dot fu-berlin dot de 2006-09-20 11:57 -------
I think this is fixed.
If there are other errors, not covered, one could still reopen this bug or
create a new one.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23375
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/23375] show location for runtime errors
[not found] <bug-23375-10391@http.gcc.gnu.org/bugzilla/>
` (7 preceding siblings ...)
2006-09-20 11:58 ` tobias dot burnus at physik dot fu-berlin dot de
@ 2006-09-28 7:59 ` fxcoudert at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2006-09-28 7:59 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from fxcoudert at gcc dot gnu dot org 2006-09-28 07:59 -------
Closing, as the error messages have been modified to include source location.
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23375
^ permalink raw reply [flat|nested] 10+ messages in thread