This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC viciously beaten by ICC in trig test!
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: Scott Robert Ladd <coyote at coyotegulch dot com>, gcc at gcc dot gnu dot org
- Date: 15 Mar 2004 03:51:14 +0100
- Subject: Re: GCC viciously beaten by ICC in trig test!
- Organization: Integrable Solutions
- References: <Pine.LNX.4.44.0403141713460.12909-100000@www.eyesopen.com>
Roger Sayle <roger@eyesopen.com> writes:
| On Sun, 14 Mar 2004, Scott Robert Ladd wrote:
| > Consider the following program, compiled and run on a Pentium 4
| > (Northwood) system:
| >
| > #include <math.h>
|
| For a number of benchmarks, just this first line of source code above
| is enough to loose the race for GCC against Intel when compiling on Linux.
|
| Consider the following:
|
| #include <math.h>
|
| double doit(double a)
| {
| return sin(a) * sin(a);
| }
|
|
| Compiling with gcc -O2 -ffast-math on Linux generates x86 code that's
| significantly slower than Intel's compiler output. However, commenting
| out the "#include <math.h>" corrects the situation and GCC can then
| generate *exactly* the same sequence as icc.
In summary, in order to get decent codes from GCC on Linux, nobody
should be including standard headers supposed to bring appropriate
declarations for names used in codes. Oh well.
[...]
| Just another data point. Avoiding <math.h> may improve your performance
That is a joke ;-)
In real world, people have to include standard headers in order to get
appropriate declarations.
-- Gaby