public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug fortran/43849] New: Add _gfortran_finalize function to close down the library @ 2010-04-22 12:49 burnus at gcc dot gnu dot org 2010-04-22 13:19 ` [Bug fortran/43849] " burnus at gcc dot gnu dot org 2010-04-22 13:30 ` burnus at gcc dot gnu dot org 0 siblings, 2 replies; 5+ messages in thread From: burnus at gcc dot gnu dot org @ 2010-04-22 12:49 UTC (permalink / raw) To: gcc-bugs Currently, gfortran only has start up routines, cf. http://gcc.gnu.org/onlinedocs/gfortran/Non_002dFortran-Main-Program.html I think it makes sense to also add shutdown routines. Currently, _gfortran_abort calls: close_units (); Additionally, one should call: flush_all_units (); For some reasons _gfortran_exit_i(4,8) does not. And, I think it would make sense to call the unit flushing (via the shutdown routine) also for "STOP" and when leaving the main program. And non-Fortran main programs should do the same (cf. link above). The (externally visible) shutdown routine shall return and leave the exiting of the program to the caller. -- Summary: Add _gfortran_finalize function to close down the library Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: burnus at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43849 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug fortran/43849] Add _gfortran_finalize function to close down the library 2010-04-22 12:49 [Bug fortran/43849] New: Add _gfortran_finalize function to close down the library burnus at gcc dot gnu dot org @ 2010-04-22 13:19 ` burnus at gcc dot gnu dot org 2010-04-22 13:30 ` burnus at gcc dot gnu dot org 1 sibling, 0 replies; 5+ messages in thread From: burnus at gcc dot gnu dot org @ 2010-04-22 13:19 UTC (permalink / raw) To: gcc-bugs ------- Comment #1 from burnus at gcc dot gnu dot org 2010-04-22 13:19 ------- Thus: a) Create a function named, e.g., _gfortran_shutdown/_gfortran_finalize, which calls flush_all_units (); close_units (); b) Call it from: _gfortran_abort _gfortran_stop_numeric; _gfortran_stop_string; _gfortran_error_stop_string _gfortran_error_stop_numeric (not yet existing) and maybe from the run-time error calls such as _gfortran_runtime_error _gfortran_runtime_error_at c) Change trans-decl.c's create_main_function to call it d) Update gfortran.texi e) Add a call to the gfortran CAF library for ERROR STOP -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43849 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug fortran/43849] Add _gfortran_finalize function to close down the library 2010-04-22 12:49 [Bug fortran/43849] New: Add _gfortran_finalize function to close down the library burnus at gcc dot gnu dot org 2010-04-22 13:19 ` [Bug fortran/43849] " burnus at gcc dot gnu dot org @ 2010-04-22 13:30 ` burnus at gcc dot gnu dot org 1 sibling, 0 replies; 5+ messages in thread From: burnus at gcc dot gnu dot org @ 2010-04-22 13:30 UTC (permalink / raw) To: gcc-bugs ------- Comment #2 from burnus at gcc dot gnu dot org 2010-04-22 13:29 ------- Forgot to mention that one can then also print the exception status: "8.4 STOP and ERROR STOP statements" (F2008 FDIS): "If any exception (cf. 14 Exceptions and IEEE arithmetic) is signaling on that image, the processor shall issue a warning indicating which exceptions are signaling; this warning shall be on the unit identified by the named constant ERROR_UNIT (13.8.2.8). It is recommended that the stop code is made available by formatted output to the same unit." -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43849 ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <bug-43849-4@http.gcc.gnu.org/bugzilla/>]
* [Bug fortran/43849] Add _gfortran_finalize function to close down the library [not found] <bug-43849-4@http.gcc.gnu.org/bugzilla/> @ 2010-11-03 16:31 ` jb at gcc dot gnu.org 2013-12-21 20:36 ` dominiq at lps dot ens.fr 1 sibling, 0 replies; 5+ messages in thread From: jb at gcc dot gnu.org @ 2010-11-03 16:31 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43849 Janne Blomqvist <jb at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jb at gcc dot gnu.org --- Comment #3 from Janne Blomqvist <jb at gcc dot gnu.org> 2010-11-03 16:31:08 UTC --- In runtime/main.c we have static void __attribute__((destructor)) cleanup (void) { close_units (); if (please_free_exe_path_when_done) free ((char *) exe_path); } As this function is marked with the destructor attribute, it will be called when the library is unloaded during program shutdown. It might make sense to add fbuf_flush(u); sflush(u); to some appropriate place in unit.c(close_unit_1). That is, make sure to flush the unit as part of the closing procedure. ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug fortran/43849] Add _gfortran_finalize function to close down the library [not found] <bug-43849-4@http.gcc.gnu.org/bugzilla/> 2010-11-03 16:31 ` jb at gcc dot gnu.org @ 2013-12-21 20:36 ` dominiq at lps dot ens.fr 1 sibling, 0 replies; 5+ messages in thread From: dominiq at lps dot ens.fr @ 2013-12-21 20:36 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43849 Dominique d'Humieres <dominiq at lps dot ens.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |WAITING Last reconfirmed| |2013-12-21 Ever confirmed|0 |1 --- Comment #4 from Dominique d'Humieres <dominiq at lps dot ens.fr> --- Is this PR still pertinent (2013-12-21)? ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-12-21 20:36 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2010-04-22 12:49 [Bug fortran/43849] New: Add _gfortran_finalize function to close down the library burnus at gcc dot gnu dot org 2010-04-22 13:19 ` [Bug fortran/43849] " burnus at gcc dot gnu dot org 2010-04-22 13:30 ` burnus at gcc dot gnu dot org [not found] <bug-43849-4@http.gcc.gnu.org/bugzilla/> 2010-11-03 16:31 ` jb at gcc dot gnu.org 2013-12-21 20:36 ` dominiq at lps dot ens.fr
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).