summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-07 05:23:03 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-07 05:23:03 +0000
commit74fe1cc3d9826aeafa281709397c75e63e617fb6 (patch)
treef275417cebaefe5deb9150fbd2c0293cb2f1415b /string.c
parent4d3c254ebe0eae7d97d4bd92efbcdc9d3f956c08 (diff)
string.c: this assumption is false [ci skip]
Looking at the lines right above, it is clear than a blue sky that we cannot assume `p` to be aligned at all when UNALIGNED_WORD_ACCESS is true. It is a wrong idea to use __builtin_assume_aligned for that situation. See also: https://travis-ci.org/ruby/ruby/jobs/451710732#L2007 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/string.c b/string.c
index 42f9b53148..5a5cbb576c 100644
--- a/string.c
+++ b/string.c
@@ -490,7 +490,7 @@ search_nonascii(const char *p, const char *e)
}
}
#endif
-#ifdef HAVE_BUILTIN___BUILTIN_ASSUME_ALIGNED
+#if defined(HAVE_BUILTIN___BUILTIN_ASSUME_ALIGNED) &&! UNALIGNED_WORD_ACCESS
#define aligned_ptr(value) \
__builtin_assume_aligned((value), sizeof(uintptr_t))
#else