From: Victor Stinner Date: Mon, 23 Mar 2015 20:20:27 +0000 (+0100) Subject: Issue #23654: Fix faulthandler._stack_overflow() for the Intel C Compiler (ICC) X-Git-Tag: v3.5.0a3~80^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=19276f184f00829ce55ce0e98f8db06d93b7d665;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Misc/ACKS b/Misc/ACKS index cdee1bbcf8fe..d0d5e257d255 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -436,6 +436,7 @@ Doug Fort Chris Foster John Fouhy Andrew Francis +Matt Frank Stefan Franke Martin Franklin Kent Frazier diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c index 01e7beb25500..c729414a4979 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 */