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 | |
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')
-rw-r--r-- | libgfortran/ChangeLog | 7 | ||||
-rw-r--r-- | libgfortran/gfortran.map | 1 | ||||
-rw-r--r-- | libgfortran/runtime/stop.c | 22 |
3 files changed, 29 insertions, 1 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 58a7a93..c47cac3 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,10 @@ +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-18 Jerry DeLisle <jvdelisle@gcc.gnu.org> * io/io.h: Remove definition of the BT enumerator. diff --git a/libgfortran/gfortran.map b/libgfortran/gfortran.map index c85ebf7..b5fad17 100644 --- a/libgfortran/gfortran.map +++ b/libgfortran/gfortran.map @@ -1141,6 +1141,7 @@ GFORTRAN_1.4 { _gfortran_parity_l8; _gfortran_parity_l16; _gfortran_selected_real_kind2008; + _gfortran_stop_numeric_f08; _gfortran_transfer_array_write; _gfortran_transfer_character_write; _gfortran_transfer_character_wide_write; 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)); |