]> granicus.if.org Git - libatomic_ops/commitdiff
Fix fetch_compare_and_swap asm constraints in gcc/x86.h
authorIvan Maidanski <ivmai@mail.ru>
Fri, 29 Mar 2013 04:00:42 +0000 (08:00 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 29 Mar 2013 10:01:20 +0000 (14:01 +0400)
* src/atomic_ops/sysdeps/gcc/x86.h (AO_fetch_compare_and_swap_full):
Use same asm constraints for old_val and new_val as in
AO_compare_and_swap_full.

src/atomic_ops/sysdeps/gcc/x86.h

index bed51d1ce5224270f7dfbd4d463ee709d3afcc7d..9ce3949c95b6802cad838098acfc310b2b4c4209 100644 (file)
@@ -163,7 +163,7 @@ AO_fetch_compare_and_swap_full(volatile AO_t *addr, AO_t old_val,
     AO_t fetched_val;
     __asm__ __volatile__ ("lock; cmpxchg %3, %4"
                         : "=a" (fetched_val), "=m" (*addr)
-                        : "0" (old_val), "q" (new_val), "m" (*addr)
+                        : "a" (old_val), "r" (new_val), "m" (*addr)
                         : "memory");
     return fetched_val;
 # endif