Fix 'bad register name %sil' assembler error (GCC-4.4/x86)
authorIvan Maidanski <ivmai@mail.ru>
Thu, 5 Oct 2017 08:40:31 +0000 (11:40 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 13 Oct 2017 07:09:53 +0000 (10:09 +0300)
(fix commit 7708b76)

* src/atomic_ops/sysdeps/gcc/x86.h [!AO_USE_SYNC_CAS_BUILTIN]
(AO_char_fetch_compare_and_swap_full): Replace "r"(new_val) to
"q"(new_val) in __asm__("cmpxchgb").

src/atomic_ops/sysdeps/gcc/x86.h

index 20bf77f..3ab1f76 100644 (file)
@@ -292,7 +292,7 @@ AO_fetch_compare_and_swap_full(volatile AO_t *addr, AO_t old_val,
 
       __asm__ __volatile__ ("lock; cmpxchgb %3, %4"
                             : "=a" (fetched_val), "=m" (*addr)
-                            : "a" (old_val), "r" (new_val), "m" (*addr)
+                            : "a" (old_val), "q" (new_val), "m" (*addr)
                             : "memory");
       return fetched_val;
 #   endif