ruby-changes:41472
From: nobu <ko1@a...>
Date: Fri, 15 Jan 2016 22:15:09 +0900 (JST)
Subject: [ruby-changes:41472] nobu:r53546 (trunk): disable unaligned word access
nobu 2016-01-15 22:15:39 +0900 (Fri, 15 Jan 2016) New Revision: 53546 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53546 Log: disable unaligned word access * include/ruby/defines.h, st.c: disable unaligned word access with gcc 6 or later. [Bug #11831] Modified files: trunk/include/ruby/defines.h trunk/st.c Index: include/ruby/defines.h =================================================================== --- include/ruby/defines.h (revision 53545) +++ include/ruby/defines.h (revision 53546) @@ -260,6 +260,10 @@ void rb_ia64_flushrs(void); https://github.com/ruby/ruby/blob/trunk/include/ruby/defines.h#L260 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) || \ Index: st.c =================================================================== --- st.c (revision 53545) +++ st.c (revision 53546) @@ -1379,6 +1379,10 @@ strhash(st_data_t arg) https://github.com/ruby/ruby/blob/trunk/st.c#L1379 } #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) || \ -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/