https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53379

--- Comment #21 from Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> 
---
(In reply to Janne Blomqvist from comment #11)
> Looking at the frontend, calls to runtime_error_at are generated from
> gfc_trans_runtime_check() and gfc_trans_runtime_error(). I went through
> calls to these functions, and IMHO they all look like serious errors worthy
> of a backtrace, with the exception of ALLOCATE/DEALLOCATE failures when
> STAT= is not specified. In that case F2008 specifies that the processor must
> proceed with error termination, and printing a backtrace for this case would
> be a bit inconsistent with other cases of error termination.

actually, I just created PR67414 where I ask for a backtrace on a failed
allocate if stat is not specified.

Since it is mostly a 'taste' issue when to emit a backtrace or not, I think it
makes sense to just make it an option flag, either never or always emit a
backtrace. The flag '-fbacktrace' already exists and it could imply generate a
backtrace on every 'error termination', run time error, or deadly signals. 

I would find that very useful.

Reply via email to