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

Tom May (
28 Sep 1996 13:59:59 -0700

Linus Torvalds <> writes:

> Ok, I asked Werner to send me a disassembly of the affected function, and he
> definitely had some bad code produced by his compiler for the new inline
> assembly code to handle semaphores.

Since I have posted a patch to gcc on this list (relating to memory
clobber not being honored in all cases), I would be extremely
interested in getting a copy of the failing source code and finding
out what patches Werner has applied to gcc.

> There is at least _one_ reasonably recent version of gcc out there that
> provably produces bad code when it comes to inline asm register clobbers, and
> I'd ask people to take a hard look at their compiler if they don't have a
> unpatched gcc.

What exactly should we be looking for? Can you point out a specific
function or code construct that compiles incorrectly?

> It looks like the standard gcc's are ok, but I wonder about
> gcc- (which reportedly also fixes the strength-reduce bug, and if they
> used the same bugfix as Werners version did, it may be suspect).

gcc- has a different fix for the strength reduce bug than the
patch posted to this list a long time ago. The posted patch should
definitely not affect clobbers. The gcc- patch is more
mystical but it is still in an area of the compiler that has nothing
to do with clobbers. That's not to say that gcc- isn't broken,
although I'm using it to compile 2.0.21.