summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-03-23 20:20:27 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-03-23 20:20:27 (GMT)
commit19276f184f00829ce55ce0e98f8db06d93b7d665 (patch)
tree6ff82eeae3c48489efb8c1db2aa0d0724692f7bf /Modules
parentd4c2ac83944e48a02e5f11adba312d5b3b985150 (diff)
downloadcpython-19276f184f00829ce55ce0e98f8db06d93b7d665.zip
cpython-19276f184f00829ce55ce0e98f8db06d93b7d665.tar.gz
cpython-19276f184f00829ce55ce0e98f8db06d93b7d665.tar.bz2
Issue #23654: Fix faulthandler._stack_overflow() for the Intel C Compiler (ICC)
Issue #23654: Turn off ICC's tail call optimization for the stack_overflow generator. ICC turns the recursive tail call into a loop. Patch written by Matt Frank.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/faulthandler.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c
index 01e7beb..c729414 100644
--- a/Modules/faulthandler.c
+++ b/Modules/faulthandler.c
@@ -911,7 +911,14 @@ faulthandler_fatal_error_py(PyObject *self, PyObject *args)
}
#if defined(HAVE_SIGALTSTACK) && defined(HAVE_SIGACTION)
-static Py_uintptr_t
+#ifdef __INTEL_COMPILER
+ /* Issue #23654: Turn off ICC's tail call optimization for the
+ * stack_overflow generator. ICC turns the recursive tail call into
+ * a loop. */
+# pragma intel optimization_level 0
+#endif
+static
+Py_uintptr_t
stack_overflow(Py_uintptr_t min_sp, Py_uintptr_t max_sp, size_t *depth)
{
/* allocate 4096 bytes on the stack at each call */