summaryrefslogtreecommitdiff
path: root/libgfortran/runtime
diff options
context:
space:
mode:
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-21 00:45:15 +0000
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-21 00:45:15 +0000
commitdff2ea5fc98a56aea5ca4f6d2c6a1bc35b32dffb (patch)
treef6c2d85ba773d860c79e23d0f535c1678b5d464b /libgfortran/runtime
parent7f3fd463e12064b69d3d340c2154d70d623ea673 (diff)
downloadgcc-dff2ea5fc98a56aea5ca4f6d2c6a1bc35b32dffb.tar.gz
2010-10-20 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/46079 * runtime/stop.c (stop_numeric_f08): New function. (stop_numeric): Restore to previous behavior. * gfortran.map: Add symbol _gfortran_stop_numeric_f08. 2010-10-20 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/46079 * trans_stmt.c (gfc_trans_stop): Fix whitespace. Build a call to new F08 numeric stop function. * trans.h: Add declaration for gfor_fndecl_stop_numeric_f08. * trans-decl.c (gfc_build_builtin_function_decls): Build declaration for stop_numeric_f08. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165746 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/runtime')
-rw-r--r--libgfortran/runtime/stop.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/libgfortran/runtime/stop.c b/libgfortran/runtime/stop.c
index f2a12338175..29f5031b3af 100644
--- a/libgfortran/runtime/stop.c
+++ b/libgfortran/runtime/stop.c
@@ -35,10 +35,29 @@ export_proto(stop_numeric);
void
stop_numeric (GFC_INTEGER_4 code)
{
+ if (code == -1)
+ code = 0;
+ else
+ st_printf ("STOP %d\n", (int)code);
+
+ sys_exit (code);
+}
+
+
+/* A Fortran 2008 numeric STOP statement. */
+
+extern void stop_numeric_f08 (GFC_INTEGER_4)
+ __attribute__ ((noreturn));
+export_proto(stop_numeric_f08);
+
+void
+stop_numeric_f08 (GFC_INTEGER_4 code)
+{
st_printf ("STOP %d\n", (int)code);
sys_exit (code);
}
+
/* A character string or blank STOP statement. */
void
@@ -75,7 +94,8 @@ error_stop_string (const char *string, GFC_INTEGER_4 len)
sys_exit (1);
}
-/* A numeric or blank ERROR STOP statement. */
+
+/* A numeric ERROR STOP statement. */
extern void error_stop_numeric (GFC_INTEGER_4)
__attribute__ ((noreturn));