[m-rev.] diff: fix problems with Boehm GC and LLVM

Julien Fischer juliensf at csse.unimelb.edu.au
Mon Jul 11 15:32:23 AEST 2011


Branches: main, 11.07

Fix a problem reported by Jeremy Huddleston.

boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/gcc{x86,x86_64}.h:
 	Merge upstream changes that fix problems when compiling
 	with clang / LLVM.

Julien.

Index: boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/gcc/x86.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/gcc/x86.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 x86.h
--- boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/gcc/x86.h	23 Feb 2010 06:28:41 -0000	1.1.1.1
+++ boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/gcc/x86.h	11 Jul 2011 04:11:22 -0000
@@ -113,7 +113,7 @@
    /* 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;
  }

Index: boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/gcc/x86_64.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/gcc/x86_64.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 x86_64.h
--- boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/gcc/x86_64.h	23 Feb 2010 06:28:41 -0000	1.1.1.1
+++ boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/gcc/x86_64.h	11 Jul 2011 04:12:14 -0000
@@ -119,7 +119,7 @@
    /* 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;
  }


--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list