summaryrefslogtreecommitdiffstats
path: root/Include/pymacro.h
diff options
context:
space:
mode:
authorDong-hee Na <donghee.na92@gmail.com>2020-09-28 20:41:23 (GMT)
committerGitHub <noreply@github.com>2020-09-28 20:41:23 (GMT)
commit24ba3b0df5e5f2f237d7b23b4017ba12f16320ae (patch)
tree11ef620ae2b48d6faf15bfc502c1308ba000f710 /Include/pymacro.h
parentff9147d93b868f0e13b9fe14e2a76c2879f6787b (diff)
downloadcpython-24ba3b0df5e5f2f237d7b23b4017ba12f16320ae.zip
cpython-24ba3b0df5e5f2f237d7b23b4017ba12f16320ae.tar.gz
cpython-24ba3b0df5e5f2f237d7b23b4017ba12f16320ae.tar.bz2
bpo-41875: Use __builtin_unreachable when possible (GH-22433)
Diffstat (limited to 'Include/pymacro.h')
-rw-r--r--Include/pymacro.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/Include/pymacro.h b/Include/pymacro.h
index 856cae7..202b936 100644
--- a/Include/pymacro.h
+++ b/Include/pymacro.h
@@ -118,7 +118,9 @@
"We've reached an unreachable state. Anything is possible.\n" \
"The limits were in our heads all along. Follow your dreams.\n" \
"https://xkcd.com/2200")
-#elif defined(__GNUC__) || defined(__clang__) || defined(__INTEL_COMPILER)
+#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
+# define Py_UNREACHABLE() __builtin_unreachable()
+#elif defined(__clang__) || defined(__INTEL_COMPILER)
# define Py_UNREACHABLE() __builtin_unreachable()
#elif defined(_MSC_VER)
# define Py_UNREACHABLE() __assume(0)