Commit 2942b909 authored by INADA Naoki's avatar INADA Naoki Committed by GitHub

bpo-32616: Disable computed gotos by default for clang < 5 (GH-5574)

parent 0a18422b
Disable computed gotos by default for clang < 5.0. It caused significant
performance regression.
...@@ -689,11 +689,19 @@ PyObject * ...@@ -689,11 +689,19 @@ PyObject *
PyEval_EvalFrameEx(PyFrameObject *f, int throwflag) PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
{ {
#ifdef DYNAMIC_EXECUTION_PROFILE #ifdef DYNAMIC_EXECUTION_PROFILE
#undef USE_COMPUTED_GOTOS #undef USE_COMPUTED_GOTOS
#endif #endif
#ifdef HAVE_COMPUTED_GOTOS #ifdef HAVE_COMPUTED_GOTOS
#ifndef USE_COMPUTED_GOTOS #ifndef USE_COMPUTED_GOTOS
#define USE_COMPUTED_GOTOS 1 #if defined(__clang__) && (__clang_major__ < 5)
/* Computed gotos caused significant performance regression
* with clang < 5.0.
* https://bugs.python.org/issue32616
*/
#define USE_COMPUTED_GOTOS 0
#else
#define USE_COMPUTED_GOTOS 1
#endif
#endif #endif
#else #else
#if defined(USE_COMPUTED_GOTOS) && USE_COMPUTED_GOTOS #if defined(USE_COMPUTED_GOTOS) && USE_COMPUTED_GOTOS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment