http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57598
Bug ID: 57598 Summary: [Coarray,caf] Add FPE-Summary printing (floating-point exception) for STOP/ERROR STOP Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: burnus at gcc dot gnu.org Fortran 2008 demands that the compiler prints a summary of the FPE at STOP/ERROR STOP. The patch at http://gcc.gnu.org/ml/fortran/2013-06/msg00077.html adds support for noncoarrays. One needs to do likewise for coarrays. However, as Bill pointed out at http://mailman.j3-fortran.org/pipermail/j3/2013-June/006458.html, printing on 32k images Note: On image n, the following floating-point exception are signalling: IEEE_DIVIDE_BY_ZERO is not a good idea. It's better to collect those statuses and print something like: Note: 1453 images terminated reporting a DIVIDE_BY_ZERO exception, ... For true multi-image support, one also needs to pass compile_options.fpe_summary to the CAF library and handle collecting all the flags (collective SUM reduction). Also STOP has to be handled, not only ERROR STOP as it is currently done. Note: Fortran 201x might change the handling, cf. thread at http://mailman.j3-fortran.org/pipermail/j3/2013-June/006452.html Simple patch for caf_single: --- a/libgfortran/caf/single.c +++ b/libgfortran/caf/single.c @@ -41,0 +42,3 @@ caf_static_t *caf_static_list = NULL; +/* Prototype of libgfortran's functions. */ +void _gfortran_caf_error_stop_str (const char *, int32_t); +void _gfortran_caf_error_stop (int32_t); @@ -176,6 +179 @@ _gfortran_caf_error_stop_str (const char *string, int32_t len) - fputs ("ERROR STOP ", stderr); - while (len--) - fputc (*(string++), stderr); - fputs ("\n", stderr); - - exit (1); + _gfortran_error_stop_string (string, len); @@ -188,2 +186 @@ _gfortran_caf_error_stop (int32_t error) - fprintf (stderr, "ERROR STOP %d\n", error); - exit (error); + _gfortran_error_stop_numeric_f08 (error);