From: Julian Seward Date: Mon, 4 Jan 2010 10:46:44 +0000 (+0000) Subject: Don't trash %ebx on x86-darwin; gcc doesn't like it and goes off to sulk. X-Git-Tag: svn/VALGRIND_3_6_0~416 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f936b7465bfe08fa994fcf0a425feba4acf553b1;p=thirdparty%2Fvalgrind.git Don't trash %ebx on x86-darwin; gcc doesn't like it and goes off to sulk. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11008 --- diff --git a/helgrind/tests/annotate_hbefore.c b/helgrind/tests/annotate_hbefore.c index 33aa67cc29..704e4aef02 100644 --- a/helgrind/tests/annotate_hbefore.c +++ b/helgrind/tests/annotate_hbefore.c @@ -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;