Re: ALERT! Stay away from patched gcc's (was Re: 2.0.22 will be the last version)

Linus Torvalds (torvalds@cs.helsinki.fi)
Tue, 1 Oct 1996 08:37:15 +0300 (EET DST)


On 30 Sep 1996, Steven L Baur wrote:
>
> Are you saying that if the output doesn't look like that, the GCC is O.K.?
> Or just that the `decl (%eax)' is where the badness lies?

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