summaryrefslogtreecommitdiff
path: root/arch/powerpc/atomic.h
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2014-07-19 12:19:20 -0400
committerRich Felker <dalias@aerifal.cx>2014-07-19 12:19:20 -0400
commit7fdae458bd421046a300a69dcb32953ac9450136 (patch)
treefcb42ef6be435b18760bb351d490f561e1305618 /arch/powerpc/atomic.h
parentdc9c40a609de6a79ec30013b0963a57393daa22e (diff)
downloadmusl-7fdae458bd421046a300a69dcb32953ac9450136.tar.gz
fix broken constraints for powerpc atomic cas asm
the register constraint for the address to be accessed did not convey that the asm can access the pointed-to object. as far as the compiler could tell, the result of the asm was just a pure function of the address and the values passed in, and thus the asm could be hoisted out of loops or omitted entirely if the result was not used.
Diffstat (limited to 'arch/powerpc/atomic.h')
-rw-r--r--arch/powerpc/atomic.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/atomic.h b/arch/powerpc/atomic.h
index d52ee0c6..05951a2d 100644
--- a/arch/powerpc/atomic.h
+++ b/arch/powerpc/atomic.h
@@ -31,7 +31,7 @@ static inline int a_cas(volatile int *p, int t, int s)
" stwcx. %3, 0, %1\n"
" bne- 1b\n"
"1: \n"
- : "=&r"(t) : "r"(p), "r"(t), "r"(s) : "cc", "memory" );
+ : "=&r"(t), "+m"(*p) : "r"(t), "r"(s) : "cc", "memory" );
return t;
}