Results for g++ 3.1 application testing on i686-pc-linux-gnu
Theodore Papadopoulo
Theodore.Papadopoulo@sophia.inria.fr
Thu Mar 7 12:15:00 GMT 2002
ncm-nospam@cantrip.org said:
> stepanov_v1p2.C:
> -O
> Abstraction Penalty: 1.13
> -O2
> Abstraction Penalty: 1.32
> This is very odd, and suggests an optimization bug. Also, it would be
> interesting to see what happens with -O0.
I first had the same reaction the first time Peter posted these
results. Then I remembered that the abstraction penalty is the ratio
of time between a C and a C++ version probably compiled with the same
options. Thus it does not mean that the code compiled with -O2 is
slower, it means that -O2 optimization is more effective with C than it
is with C++ which is a pity but not a bug.
One thing that comes to mind is the problem of strict aliasing not
done on classes that is currently partially re-enabled with 3.2 (or
will be soon), or temporary objects that are not completely elided
(and kept in registers).
Now, I may be wrong... There are certainly voices on the gcc lists that
can speak with better knowledge of the problems at hand.
Theo.
--------------------------------------------------------------------
Theodore Papadopoulo
Email: Theodore.Papadopoulo@sophia.inria.fr Tel: (33) 04 92 38 76 01
--------------------------------------------------------------------
More information about the Libstdc++
mailing list