[PATCH] m68k: Fix asm constraints for atomic_sub_and_test() and atomic_add_negative() (was: Re: atomic_sub_and_test() asm constraints)

From: Geert Uytterhoeven
Date: Sun Mar 21 2010 - 06:01:31 EST


On Sun, Mar 14, 2010 at 15:30, Andreas Schwab <schwab@xxxxxxxxxxxxxx> wrote:
> Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> writes:
>
>> | Â CC Â Â Âmm/memcontrol.o
>> | {standard input}: Assembler messages:
>> | {standard input}:4076: Error: operands mismatch -- statement `subl
>> 12(%fp),170(%a0)' ignored
>>
>> Seems like we have bad asm constraints in
>>
>> static inline int atomic_sub_and_test(int i, atomic_t *v)
>> {
>> Â Â Â Â char c;
>> Â Â Â Â __asm__ __volatile__("subl %2,%1; seq %0" : "=d" (c), "+m"
>> (*v): "g" (i));
>
> Surely "g" is wrong, sub only accepts a data register as source operand
> when the destination is in memory.