Unwanted compiler optimization (was: Bug report and fix for adaptive step size control in ODE solving)

Brian Gough bjg@network-theory.co.uk
Fri Jan 4 10:44:00 GMT 2008

At Thu, 3 Jan 2008 10:00:54 +0100,
Jochen Küpper wrote:
> Is this an optimization that is considered valid even for floating- 
> point calculations in compiler building?

For general variables no, I don't think so - it only is used if there are
constants on both sides and -ffast-math/-funsafe-math-optimizations is
enabled.  e.g. x+1==1 is converted to x==0 and x+2=3 is converted to x==1.
If -ffast-math is not used any comparisons should not be modified.

More information about the Gsl-discuss mailing list