提交 7fdae458 编写于 作者: R Rich Felker

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.
上级 dc9c40a6
...@@ -31,7 +31,7 @@ static inline int a_cas(volatile int *p, int t, int s) ...@@ -31,7 +31,7 @@ static inline int a_cas(volatile int *p, int t, int s)
" stwcx. %3, 0, %1\n" " stwcx. %3, 0, %1\n"
" bne- 1b\n" " bne- 1b\n"
"1: \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; return t;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册