Some x86 32bit versions of gcc apparently generate references to the
nonexistant %sil register when using when using the r input
constraint, but not with the =q constraint. The latter restricts
allocations to a/b/c/d which should all work.
" lock \n"
" cmpxchgl %4,%5 \n"
" setz %2 \n"
-: "=a" (*expected), "=m"(ptr->value), "=r" (ret)
+: "=a" (*expected), "=m"(ptr->value), "=q" (ret)
: "a" (*expected), "r" (newval), "m"(ptr->value)
: "memory", "cc");
return (bool) ret;
" lock \n"
" cmpxchgq %4,%5 \n"
" setz %2 \n"
-: "=a" (*expected), "=m"(ptr->value), "=r" (ret)
+: "=a" (*expected), "=m"(ptr->value), "=q" (ret)
: "a" (*expected), "r" (newval), "m"(ptr->value)
: "memory", "cc");
return (bool) ret;