M
Miles Bader
Marc said:This is not to say that -O3 should not be tried, of course. And
possibly -ffast-math if the OP is happy with imprecise (aka wrong)
results.
.... and if "-ffast-math" isn't acceptable itself, it's often still
worth looking at the sub-options which -ffast-math turns on (look in
the gcc manual, it gives a good description of what it does).
"-fno-math-errno" in particular can give some nice speedups by
dropping standards requirements that very few programs actually care
about.
Similarly, one of the options -ffast-math turns on,
"-funsafe-math-optimizations" (which can often yield good speedups)
actually has useful sub-options itself. Of these "-fno-trapping-math"
is not problematic for most programs, and can be very useful, as it
allows gcc to speculate expensive operations like division (because it
knows that they can't result in an exception).
[What I do is use "-ffast-math" and then _disable_ the individual
sub-options that I don't want...]
-miles