diff -Naurp mercury-11.01.orig/boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/gcc/x86.h mercury-11.01/boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/gcc/x86.h
--- boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/gcc/x86.h	2011-07-04 18:26:09.000000000 -0700
+++ boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/gcc/x86.h	2011-07-04 18:31:42.000000000 -0700
@@ -113,7 +113,7 @@ AO_test_and_set_full(volatile AO_TS_t *a
   /* 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;
 }
 
diff -Naurp mercury-11.01.orig/boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/gcc/x86_64.h mercury-11.01/boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/gcc/x86_64.h
--- boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/gcc/x86_64.h	2011-07-04 18:26:09.000000000 -0700
+++ boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/gcc/x86_64.h	2011-07-04 18:32:18.000000000 -0700
@@ -119,7 +119,7 @@ AO_test_and_set_full(volatile AO_TS_t *a
   /* 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;
 }
 
