Optimizations Enabled by -ffast-Math
I found the following note for -ffinite-math-only and -fno-signed-zeros quite worrying:<p>The program may behave in strange ways (such as not evaluating either the true or false part of an if-statement) if calculations produce Inf, NaN, or -0.0 when these flags are used.<p>I always thought that -ffast-math was telling the compiler. "I do not care about floating point standards compliance, and I do not rely on it. So optimize things that break the standard".<p>But instead it seems like this also implies a promise to the compiler. A promise that you will not produce Inf, NaN, or -0.0. 
Whilst especially Inf and NaN can be hard to exclude.<p>This changes the flag from saying "don't care about standards, make it fast" to "I hereby guarantee this code meets a stricter standard" where also it becomes quite hard to actually deduce you will meet this standard. Especially if you want to actually keep your performance. Because if you need to start putting all divisions in if statements to prevent getting Inf or NaN, that is a huge performance penalty.