]> granicus.if.org Git - libatomic_ops/commitdiff
Fix test_atomic fail caused by AO_double_t misaligned load (Linux/i686)
authorIvan Maidanski <ivmai@mail.ru>
Tue, 31 Jan 2017 07:29:44 +0000 (10:29 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 6 Feb 2017 06:36:03 +0000 (09:36 +0300)
(Cherry-pick commit a53e41b from 'master' branch.)

* src/atomic_ops/sysdeps/standard_ao_double_t.h [__i386__ && __GNUC__]
(double_ptr_storage): Add aligned(8) attribute (so that AO_double_t
global/static variables to have proper (double-word) alignment).

src/atomic_ops/sysdeps/standard_ao_double_t.h

index 6814ad70b19ada960eaa122d8581ac1c05a5d1d7..2a676ea0acf28bc7d672f37f5045a5a93ce01a85 100644 (file)
@@ -34,6 +34,9 @@
   typedef unsigned __int64 double_ptr_storage;
 #elif defined(__aarch64__)
   typedef unsigned __int128 double_ptr_storage;
+#elif defined(__i386__) && defined(__GNUC__)
+  typedef unsigned long long double_ptr_storage
+                                __attribute__((__aligned__(8)));
 #else
   typedef unsigned long long double_ptr_storage;
 #endif