2011-06-27 Ivan Maidanski <ivmai@mail.ru> (really Jeremy Huddleston)
authorivmai <ivmai>
Mon, 27 Jun 2011 06:48:12 +0000 (06:48 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 25 Jul 2011 12:03:27 +0000 (16:03 +0400)
* src/atomic_ops/sysdeps/gcc/x86.h (AO_test_and_set_full):
Explicitly cast 0xff to unsigned char (otherwise LLVM v2.7 GAS
reports an error); don't recognize AO_XCHGB_RET_WORD.
* src/atomic_ops/sysdeps/gcc/x86_64.h (AO_test_and_set_full):
Ditto.

ChangeLog
src/atomic_ops/sysdeps/gcc/x86.h
src/atomic_ops/sysdeps/gcc/x86_64.h

index 8cb2c92..8f417b6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-06-27  Ivan Maidanski <ivmai@mail.ru> (really Jeremy Huddleston)
+
+       * src/atomic_ops/sysdeps/gcc/x86.h (AO_test_and_set_full):
+       Explicitly cast 0xff to unsigned char (otherwise LLVM v2.7 GAS
+       reports an error); don't recognize AO_XCHGB_RET_WORD.
+       * src/atomic_ops/sysdeps/gcc/x86_64.h (AO_test_and_set_full):
+       Ditto.
+
 2011-06-15  Ivan Maidanski <ivmai@mail.ru>
 
        * configure.ac, README: Change to version 7.2alpha7.
index 5e6d7fa..807afc1 100644 (file)
@@ -104,16 +104,11 @@ AO_or_full (volatile AO_t *p, AO_t incr)
 AO_INLINE AO_TS_VAL_t
 AO_test_and_set_full(volatile AO_TS_t *addr)
 {
-# ifdef AO_XCHGB_RET_WORD
-    /* Workaround for a bug in LLVM v2.7 GAS.   */
-    unsigned oldval;
-# else
-    unsigned char oldval;
-# endif
+  unsigned char oldval;
   /* Note: the "xchg" instruction does not need a "lock" prefix */
   __asm__ __volatile__("xchgb %0, %1"
                 : "=q"(oldval), "=m"(*addr)
-                : "0"(0xff), "m"(*addr) : "memory");
+                : "0"((unsigned char)0xff), "m"(*addr) : "memory");
   return (AO_TS_VAL_t)oldval;
 }
 #define AO_HAVE_test_and_set_full
index 0f68c1e..3cbe76e 100644 (file)
@@ -101,16 +101,11 @@ AO_or_full (volatile AO_t *p, AO_t incr)
 AO_INLINE AO_TS_VAL_t
 AO_test_and_set_full(volatile AO_TS_t *addr)
 {
-# ifdef AO_XCHGB_RET_WORD
-    /* Workaround for a bug in LLVM v2.7 GAS.   */
-    unsigned oldval;
-# else
-    unsigned char oldval;
-# endif
+  unsigned char oldval;
   /* Note: the "xchg" instruction does not need a "lock" prefix */
   __asm__ __volatile__("xchgb %0, %1"
                 : "=q"(oldval), "=m"(*addr)
-                : "0"(0xff), "m"(*addr) : "memory");
+                : "0"((unsigned char)0xff), "m"(*addr) : "memory");
   return (AO_TS_VAL_t)oldval;
 }
 #define AO_HAVE_test_and_set_full