It's the decl (%eax) which is _always_ wrong for that piece of code. If you
don't have it, I can't guarantee that your gcc is 100% ok, but at least you
don't have that particular bug.
> This is what my GCC 2.7.2 with a no-sr-bug patch produces (from 2.0.21
> for i486):
>
> call scsi_do_cmd
> addl $28,%esp
> movl %ebx,%ecx
> #APP
> # atomic down operation
> 1:
> movl $1b,%eax
> decl (%ebx)
> js down_failed
> #NO_APP
> movl 240(%ebp),%edi
> movl %edi,20(%esp)
> decl %esi
> testl %edi,%edi
> je .L1721
> testl %esi,%esi
> jne .L1720
Yes, this is what it should look like (the format is different from the one I
posted, but that's because the posted example was created with gdb and
disassemble rather than pasted from the .s file). Note that other gcc
versions can have different register allocation, so the above is certainly
not the only correct way to compile it, but the above is what you should see
with a good gcc-2.7.2.
Linus