Fwd: Re: [Shootout-list] Science-related benchmarks (speedoptimisation)

Jon Harrop jon@ffconsultancy.com
Wed, 27 Apr 2005 16:43:42 +0100


On Wednesday 27 April 2005 15:37, Pascal Obry wrote:
>  > IIRC, the -O3 switch is allowed to alter the output of the program. It
>  > certainly does here. Thus, it is used by some people and not by others.
>
> That's certainly wrong.

According to the gcc docs, you're right. The -O* switches should not invoke=
=20
any of the optimisations (like -ffast-math) which can alter the results.

> An optimization level must not change the output of=20
> a program. Either the program or the compiler is boggus.

Perhaps I have relied upon some strictly undefined behaviour. Unfortunately=
=20
I've lost the data that gave those results...

=46rom the point of view of the shootout, you still need to be careful whic=
h=20
optimisation flags you pass as some of them can alter the result. Moreover,=
=20
warning flags in gcc can affect the order in which optimisations are applie=
d=20
which could also, therefore, alter the results in the presence of these=20
optimisation flags.

=2D-=20
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
Objective CAML for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists