Commits

Armin Rigo  committed 7ee2656

fixes

  • Participants
  • Parent commits dda0292
  • Branches fast-gil

Comments (0)

Files changed (2)

File rpython/translator/c/gcc/trackgcroot.py

         return []
 
     def _visit_xchg(self, line):
+        # ignore the special locking xchg put there by custom assembler
+        # in thread_pthread.c, with an associated comment
+        if line.endswith('*/\n'):
+            return []
         # only support the format used in VALGRIND_DISCARD_TRANSLATIONS
         # which is to use a marker no-op "xchgl %ebx, %ebx"
         match = self.r_binaryinsn.match(line)

File rpython/translator/c/src/thread_pthread.c

 {
     void *result;
 #if defined(__amd64__)
-    asm volatile ("xchgq %0, %1  /* automatically locked */"
+    asm volatile ("xchgq %0, %2  /* automatically locked */"
                   : "=r"(result) : "0"(value), "m"(*ptr) : "memory");
 #elif defined(__i386__)
-    asm volatile ("xchgl %0, %1  /* automatically locked */"
+    asm volatile ("xchgl %0, %2  /* automatically locked */"
                   : "=r"(result) : "0"(value), "m"(*ptr) : "memory");
 #else
     /* requires gcc >= 4.1 */