[Bug c/46186] Clang creates code running 1600 times faster than gcc's

jak@jak-linux.org gcc-bugzilla@gcc.gnu.org
Tue Oct 26 15:00:00 GMT 2010


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46186

--- Comment #7 from Julian Andres Klode <jak@jak-linux.org> 2010-10-26 15:00:37 UTC ---
(In reply to comment #5)
> (In reply to comment #4)
> > GCC's output is significantly faster at -O3 or without the noinline attribute
> 
> I just tested and at -O3, gcc-4.4 creates slow code and gcc-4.5 fast code. At
> -O2, both are equally fast. The clang 1.1 code at -O2 is as fast as GCC 4.5's
> code at -O3.

Using gcc 4.5 with -O3 may work for the C code, but it does not optimize the
C++ code posted at http://lwn.net/Articles/411776/:

    g++-4.5 -O3: real 0m1.608s
    clang++ -O2: real 0m0.003s
    clang++ -Os: real 0m0.003s

But I guess the C++ problem might be a different one.



More information about the Gcc-bugs mailing list