summaryrefslogtreecommitdiff
path: root/include/ruby
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2020-05-20 02:37:58 +0900
committerKoichi Sasada <ko1@atdot.net>2020-05-20 10:29:38 +0900
commit67d259c5dccd31fe49d417fec169977712ffdf10 (patch)
tree75ec8971b3636cb0ee2876fd25ff369b13f6efaf /include/ruby
parenta6403091a58582bbc0fbe8e2fb33d52cd47391b9 (diff)
Use __bultin_assume() from clang-7
We observed combination of multiple __builtin_assume() can cause strange compile results on clang-6 (-DNDEBUG exposed this issue). To avoid this problem, __builtin_assume() is from clang-7. https://github.com/ruby/ruby/pull/3120#issuecomment-630821333
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3122
Diffstat (limited to 'include/ruby')
-rw-r--r--include/ruby/assert.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/ruby/assert.h b/include/ruby/assert.h
index ac9b9c8cc3..a79abea582 100644
--- a/include/ruby/assert.h
+++ b/include/ruby/assert.h
@@ -90,7 +90,7 @@ RBIMPL_SYMBOL_EXPORT_END()
# define RBIMPL_ASSERT_OR_ASSUME(_) RUBY_ASSERT(_)
#elif defined(RBIMPL_HAVE___ASSUME)
# define RBIMPL_ASSERT_OR_ASSUME(_) RBIMPL_ASSUME(_)
-#elif RBIMPL_HAS_BUILTIN(__builtin_assume)
+#elif RBIMPL_HAS_BUILTIN(__builtin_assume) && RBIMPL_COMPILER_SINCE(Clang, 7, 0, 0)
# define RBIMPL_ASSERT_OR_ASSUME(_) RBIMPL_ASSUME(_)
#else
# define RBIMPL_ASSERT_OR_ASSUME(_) /* void */