1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

disable unaligned word access

* include/ruby/defines.h, st.c: disable unaligned word access with
  gcc 6 or later.  [Bug #11831]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-01-15 13:15:39 +00:00
parent 04c55c0783
commit fd7b490fc3
2 changed files with 8 additions and 0 deletions

View file

@ -260,6 +260,10 @@ void rb_ia64_flushrs(void);
RUBY_ALIAS_FUNCTION_TYPE(VALUE, prot, name, args)
#endif
#if !defined(UNALIGNED_WORD_ACCESS) && defined(__GNUC__) && __GNUC__ >= 6
# define UNALIGNED_WORD_ACCESS 0
#endif
#ifndef UNALIGNED_WORD_ACCESS
# if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \
defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || \

4
st.c
View file

@ -1379,6 +1379,10 @@ strhash(st_data_t arg)
}
#else
#if !defined(UNALIGNED_WORD_ACCESS) && defined(__GNUC__) && __GNUC__ >= 6
# define UNALIGNED_WORD_ACCESS 0
#endif
#ifndef UNALIGNED_WORD_ACCESS
# if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \
defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || \