This is the mail archive of the
mailing list for the GCC project.
Re: egcs 1.0.1 miscompiles Linux 2.0.33
- To: John Carr <jfc at mit dot edu>
- Subject: Re: egcs 1.0.1 miscompiles Linux 2.0.33
- From: Linus Torvalds <torvalds at transmeta dot com>
- Date: Sun, 1 Mar 1998 14:08:59 -0800 (PST)
- cc: law at cygnus dot com, Gabriel Paubert <paubert at iram dot es>, linux-kernel at vger dot rutgers dot edu, egcs at cygnus dot com
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