the original problem that Richard located at: if (f_sq > 0) f = std::sqrt(f_sq); else f = 0;is interesting. It seems that sqrt is hoisted in some situations whichcauses problems with -ffast-math.I wouldn't think that compiler may speculatively run sqrt, but itcan[1], it must be sometimes faster.[1] http://reviews.llvm.org/D2428
I managed to fix the problem by copying f_sq into a volatile temporary f_sq_ of which I then take the square root. So I tend to agree with your guess.
PS. this is rather heavy-handed:
r24214 | rjgildea | 2016-04-07 16:42:49 +0100 (czw, 07 kwi 2016) | 1 line
A couple of dials tests crash after XCode 7.3 update with -O2 or -O3
flags set: setting -O1 optimization appears