From: Kwok Cheung Yeung Date: Wed, 12 Sep 2018 13:53:34 +0000 (+0000) Subject: Fix interleaving of Fortran STOP messages X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=72ced87475c02fc6d4211a9baa41a8c8bb14ab0c;p=gcc.git Fix interleaving of Fortran STOP messages Fortran STOP and ERROR STOP use a different function to print the "STOP" string and the message string. On GCN this results in out-of-order output, such as "ERROR STOP ". This patch fixes the problem by making estr_write use the proper Fortran write, not C printf, so both parts are now output the same way. This also ensures that both parts are output to STDERR (not that that means anything on GCN). 2018-09-12 Kwok Cheung Yeung libgfortran/ * runtime/minimal.c (estr_write): Define in terms of write. From-SVN: r264239 --- diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 00a07b19255..1120d30fd2a 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,7 @@ +2018-09-12 Kwok Cheung Yeung + + * runtime/minimal.c (estr_write): Define in terms of write. + 2018-09-12 Andrew Stubbs * runtime/minimal.c (exit): Only work around nvptx bugs on nvptx. diff --git a/libgfortran/runtime/minimal.c b/libgfortran/runtime/minimal.c index 8940f975160..b6d26fd2228 100644 --- a/libgfortran/runtime/minimal.c +++ b/libgfortran/runtime/minimal.c @@ -196,7 +196,7 @@ sys_abort (void) #undef st_printf #define st_printf printf #undef estr_write -#define estr_write printf +#define estr_write(X) write(STDERR_FILENO, (X), strlen (X)) #if __nvptx__ /* Map "exit" to "abort"; see PR85463 '[nvptx] "exit" in offloaded region doesn't terminate process'. */