]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Don't trash %ebx on x86-darwin; gcc doesn't like it and goes off to sulk.
authorJulian Seward <jseward@acm.org>
Mon, 4 Jan 2010 10:46:44 +0000 (10:46 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 4 Jan 2010 10:46:44 +0000 (10:46 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11008

helgrind/tests/annotate_hbefore.c

index 33aa67cc29dcd8483c97740fc85a0770d41f1c83..704e4aef02e5faae09510c62f5aac932e0a9fda2 100644 (file)
@@ -117,16 +117,18 @@ UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
 {
    UWord block[4] = { (UWord)addr, expected, nyu, 2 };
    __asm__ __volatile__(
+      "pushl %%ebx"                   "\n\t"
       "movl 0(%%esi),  %%edi"         "\n\t" // addr
       "movl 4(%%esi),  %%eax"         "\n\t" // expected
       "movl 8(%%esi),  %%ebx"         "\n\t" // nyu
       "xorl %%ecx,%%ecx"              "\n\t"
       "lock; cmpxchgl %%ebx,(%%edi)"  "\n\t"
       "setz %%cl"                     "\n\t"
-      "movl %%ecx, 12(%%esi)"         "\n"
+      "movl %%ecx, 12(%%esi)"         "\n\t"
+      "popl %%ebx"                    "\n"
       : /*out*/ 
       : /*in*/ "S"(&block[0])
-      : /*trash*/"memory","cc","edi","eax","ebx","ecx"
+      : /*trash*/"memory","cc","edi","eax","ecx"
    );
    assert(block[3] == 0 || block[3] == 1);
    return block[3] & 1;