From da8fd78f78a01606263969f0b79a464834aedb4c Mon Sep 17 00:00:00 2001 From: jb Date: Thu, 22 Feb 2018 16:14:21 +0000 Subject: PR 78534, 84509 Fix libgfortran API for PAUSE statement This patch changes the libgfortran API for the PAUSE statement. By passing a GFC_INTEGER_8 it handles -fdefault-integer-8, and for the character version passing the length as a size_t. Regtested on x86_64-pc-linux-gnu, committed as obvious. gcc/fortran/ChangeLog: 2018-02-22 Janne Blomqvist PR 78534 PR 84509 * trans-decl.c (gfc_build_builtin_function_decls): Pass gfc_int8_type node to pause_numeric, size_type_node to pause_string. * trans-stmt.c (gfc_trans_pause): Likewise. libgfortran/ChangeLog: 2018-02-22 Janne Blomqvist PR 78534 PR 84509 * runtime/pause.c (pause_numeric): Modify to take GFC_INTEGER_8 argument. (pause_string): Modify to take size_t character length argument. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257903 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgfortran/runtime/pause.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libgfortran/runtime/pause.c') diff --git a/libgfortran/runtime/pause.c b/libgfortran/runtime/pause.c index 25690d8319e..3b4c17b8932 100644 --- a/libgfortran/runtime/pause.c +++ b/libgfortran/runtime/pause.c @@ -46,23 +46,23 @@ do_pause (void) /* A numeric PAUSE statement. */ -extern void pause_numeric (GFC_INTEGER_4); +extern void pause_numeric (GFC_INTEGER_8); export_proto(pause_numeric); void -pause_numeric (GFC_INTEGER_4 code) +pause_numeric (GFC_INTEGER_8 code) { - st_printf ("PAUSE %d\n", (int) code); + st_printf ("PAUSE %ld\n", (long) code); do_pause (); } /* A character string or blank PAUSE statement. */ -extern void pause_string (char *string, GFC_INTEGER_4 len); +extern void pause_string (char *string, size_t len); export_proto(pause_string); void -pause_string (char *string, GFC_INTEGER_4 len) +pause_string (char *string, size_t len) { estr_write ("PAUSE "); ssize_t w = write (STDERR_FILENO, string, len); -- cgit v1.2.1 From dbd7773a83341f3b0f2b41f0b47724e1b159ce45 Mon Sep 17 00:00:00 2001 From: jb Date: Fri, 23 Feb 2018 09:07:24 +0000 Subject: PR 84519 Handle optional QUIET specifier for STOP and ERROR STOP Fortran 2018 adds a new QUIET specifier for the STOP and ERROR STOP statements, in order to suppress the printing of signaling FP exceptions and the stop code. This patch adds the necessary library changes, but for now the new specifier is not parsed and the frontend unconditionally adds a false value for the new argument. Regtested on x86_64-pc-linux-gnu. gcc/fortran/ChangeLog: 2018-02-23 Janne Blomqvist PR fortran/84519 * trans-decl.c (gfc_build_builtin_function_decls): Add bool argument to stop and error stop decls. * trans-stmt.c (gfc_trans_stop): Add false value to argument lists. libgfortran/ChangeLog: 2018-02-23 Janne Blomqvist PR fortran/84519 * caf/libcaf.h (_gfortran_caf_stop_numeric): Add bool argument. (_gfortran_caf_stop_str): Likewise. (_gfortran_caf_error_stop_str): Likewise. (_gfortran_caf_error_stop): Likewise. * caf/mpi.c (_gfortran_caf_error_stop_str): Handle new argument. (_gfortran_caf_error_stop): Likewise. * caf/single.c (_gfortran_caf_stop_numeric): Likewise. (_gfortran_caf_stop_str): Likewise. (_gfortran_caf_error_stop_str): Likewise. (_gfortran_caf_error_stop): Likewise. (_gfortran_caf_lock): Likewise. (_gfortran_caf_unlock): Likewise. * libgfortran.h (stop_string): Add bool argument. * runtime/pause.c (do_pause): Add false argument. * runtime/stop.c (stop_numeric): Handle new argument. (stop_string): Likewise. (error_stop_string): Likewise. (error_stop_numeric): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257928 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgfortran/runtime/pause.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libgfortran/runtime/pause.c') diff --git a/libgfortran/runtime/pause.c b/libgfortran/runtime/pause.c index 3b4c17b8932..37672d4a02c 100644 --- a/libgfortran/runtime/pause.c +++ b/libgfortran/runtime/pause.c @@ -40,7 +40,7 @@ do_pause (void) fgets(buff, 4, stdin); if (strncmp(buff, "go\n", 3) != 0) - stop_string ('\0', 0); + stop_string ('\0', 0, false); estr_write ("RESUMED\n"); } -- cgit v1.2.1