]> granicus.if.org Git - libatomic_ops/commitdiff
Fix asm constraint of CAS memory operand for gcc/alpha
authorIvan Maidanski <ivmai@mail.ru>
Wed, 13 Mar 2013 18:46:24 +0000 (22:46 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 29 Mar 2013 10:21:41 +0000 (14:21 +0400)
* src/atomic_ops/sysdeps/gcc/alpha.h (AO_compare_and_swap): Use "+m"
asm constraint for *addr instead of "=m" (because the value pointed by
addr is read and written by the code).

src/atomic_ops/sysdeps/gcc/alpha.h

index 61d0433b1c9d62325daf3dcecea0ee4983d36320..f90a86a1ea387153f868c466e2b8e67665dd0c0b 100644 (file)
@@ -55,7 +55,7 @@ AO_compare_and_swap(volatile AO_t *addr,
                      "       stq_c %0,%1\n"
                      "       beq %0,1b\n"
                      "2:\n"
-                     :"=&r" (temp), "=m" (*addr), "=&r" (was_equal)
+                     : "=&r" (temp), "+m" (*addr), "=&r" (was_equal)
                      : "r" (new_val), "Ir" (old)
                      :"memory");
   return (int)was_equal;