diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2010-10-21 00:45:15 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2010-10-21 00:45:15 +0000 |
commit | cea59acecf9a1c61c53653375cef103ef6d6d143 (patch) | |
tree | f6c2d85ba773d860c79e23d0f535c1678b5d464b /libgfortran/runtime/stop.c | |
parent | 7cc2a03da23ef784bbd3f9c853af88e75b73cd7c (diff) | |
download | gcc-cea59acecf9a1c61c53653375cef103ef6d6d143.zip gcc-cea59acecf9a1c61c53653375cef103ef6d6d143.tar.gz gcc-cea59acecf9a1c61c53653375cef103ef6d6d143.tar.bz2 |
re PR fortran/46079 (ABI for empty stop statement broken)
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.
From-SVN: r165746
Diffstat (limited to 'libgfortran/runtime/stop.c')
-rw-r--r-- | libgfortran/runtime/stop.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/libgfortran/runtime/stop.c b/libgfortran/runtime/stop.c index f2a1233..29f5031 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)); |