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

--- Comment #7 from Harald Anlauf <anlauf at gmx dot de> 2011-11-23 20:14:24 
UTC ---
(In reply to comment #5)
> If this means writing
> 
> Program received signal 8 (SIGFPE).
> 
> to stderr (which is where the backtrace dump goes)
> before the actual backtrace, this would be perfect.
> 
> (I could even live well without "A fatal error occurred!",
> but I'll leave that up to you.)

I've just done this myself, using the function handler()
from a previous version of libgfortran/runtime/compile_options.c
and putting back the essential part.
With the attached patch, I get:


Program received signal 8 (SIGFPE): Floating-point exception.

Backtrace for this error:
#0  0x805891F in _gfortrani_show_backtrace at backtrace.c:261
#1  0x804951F in _gfortrani_backtrace_handler at compile_options.c:93
#2  0xFFFFE3FF
#3  0x80493B3 in foo at gfcbug113.f90:8
#4  0x804940B in backtrace at gfcbug113.f90:3

written to stderr when -fbacktrace is active, otherwise nothing.

Reply via email to