lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Wed, Feb 22, 2006 at 08:49:16PM -0500, Glenn Maynard wrote:
> On Wed, Feb 22, 2006 at 08:16:25PM -0500, Dave Dodge wrote:
> > I've actually seen a small test program where tcc produced noticably
> > faster code than gcc, but I'd consider that to be a fluke.
> Out of curiosity, can you post it?  (It might indicate an optimizer bug
> in gcc, which are sometimes good to know about, even if they've been fixed.)

Checking my notes, I should mention that this behavior was exhibited
specifically on a Pentium 4.  The same test on a Celeron (among
others) did not show a significant difference in runtime.  My guess
would be that it's some sort of instruction scheduling issue with the
P4 pipeline, and maybe just luck.  This trivial bit of code was
sufficient to demonstrate it:

#include <stdio.h>

int main(void)
        int ch;
        while((ch = getc(stdin)) != EOF)
        return 0;

Given the same random input, the gcc (3.x) version took four times as
long to run as the tcc version.  There was a brief discussion of it on
the tcc mailing list at the time, but no conclusion:

                                                  -Dave Dodge