Re: egcs 1.0.1 miscompiles Linux 2.0.33

Linus Torvalds (
Sun, 1 Mar 1998 14:08:59 -0800 (PST)

On Sun, 1 Mar 1998, John Carr wrote:
> I think this is beyond the limits of what can or should be done with gcc's
> inline assembly. strstr is a volatile asm which needs 18 instructions, 5
> registers, and takes a long time to run. I've seen cases like this where
> the separate function is faster than the inlined version because of reduced
> register pressure in the caller.

Oh, agreed. The main reason for having the string functions as inline
assembly is that I used them to teach myself inline asm back in 1991 when
there was almost no documentation on them and certainly no good examples.
They are certainly not inline assembly for any good speed reasons (at
least most of them).

I suspect that if you checked out Linux-0.01 you'd find most of the string
stuff there, and in a form that resembles the current stuff ;)

But the problem they bring up (exactly _because_ they are complex) are
generic problems. So as far as I'm concerned this really isn't an issue
about "how to get strstr() to do the right thing" but a more generic issue
of "how can I trust gcc to do inline asm correctly if it can't handle the
complex cases"..


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to