3 ms·
I've also been bit pretty hard by not realizing -ffast-math turns on -ffinite-math-only... which optimizes out nan and inf checks :\
by lfowles 10y ago
I've also been bit pretty hard by not realizing -ffast-math turns on -ffinite-math-only... which optimizes out nan and inf checks :\
- gok 10y agoMe too. Worse, at least for as recent of clang and GCC that I've tested, it doesn't warn when you do things that -ffinite-math-only makes tautological. So "if (x!=x)" happily compiles to nothing without warning when x is a float. (You get a warning if using integers)
- lfowles 10y agoSame for actual calls, I suspected x!=x could disappear silently but didn't think isfinite(x) would be optimized out.