aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/runtime/stop.c
diff options
context:
space:
mode:
authorJanne Blomqvist <jb@gcc.gnu.org>2011-05-14 11:44:09 +0300
committerJanne Blomqvist <jb@gcc.gnu.org>2011-05-14 11:44:09 +0300
commitde8bd1420e94a63faef64c2ccac021fd89a11497 (patch)
tree7992bcce7fae4d0b2746f2216e3a5e1c98df7aa2 /libgfortran/runtime/stop.c
parent1028b2bded33a9ee92db6a1a968258f3ba29aa24 (diff)
downloadgcc-de8bd1420e94a63faef64c2ccac021fd89a11497.zip
gcc-de8bd1420e94a63faef64c2ccac021fd89a11497.tar.gz
gcc-de8bd1420e94a63faef64c2ccac021fd89a11497.tar.bz2
PR 48915 Abort handling
From-SVN: r173750
Diffstat (limited to 'libgfortran/runtime/stop.c')
-rw-r--r--libgfortran/runtime/stop.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/libgfortran/runtime/stop.c b/libgfortran/runtime/stop.c
index b6f61ff..2efe239 100644
--- a/libgfortran/runtime/stop.c
+++ b/libgfortran/runtime/stop.c
@@ -41,7 +41,7 @@ stop_numeric (GFC_INTEGER_4 code)
else
st_printf ("STOP %d\n", (int)code);
- sys_exit (code);
+ exit (code);
}
@@ -55,7 +55,7 @@ void
stop_numeric_f08 (GFC_INTEGER_4 code)
{
st_printf ("STOP %d\n", (int)code);
- sys_exit (code);
+ exit (code);
}
@@ -71,7 +71,7 @@ stop_string (const char *string, GFC_INTEGER_4 len)
(void) sizeof (w); /* Avoid compiler warning about not using w. */
estr_write ("\n");
}
- sys_exit (0);
+ exit (0);
}
@@ -92,7 +92,7 @@ error_stop_string (const char *string, GFC_INTEGER_4 len)
(void) sizeof (w); /* Avoid compiler warning about not using w. */
estr_write ("\n");
- sys_exit (1);
+ sys_abort ();
}
@@ -106,5 +106,8 @@ void
error_stop_numeric (GFC_INTEGER_4 code)
{
st_printf ("ERROR STOP %d\n", (int) code);
- sys_exit (code);
+ if (options.backtrace == 1
+ || (options.backtrace == -1 && compile_options.backtrace == 1))
+ show_backtrace ();
+ exit (code);
}