All the info I can find in documentation and the web for -ffinite-math-only is “Allow optimizations for floating-point arithmetic that assume that arguments and results are not NaNs or +-Infs.” This does not seem forthcoming to me. Does anyone know exactly what those optimizations are?
Thanks
All the info I can find in documentation and the web for -ffinite-math-only is
Share
Lots of little things can be optimized under that assumption, like:
x == x–>1x * 1–>xx >= y–>!(x < y)and similar.x/x–>1if the compiler can provex != 0.x > y ? x : y.You often see this assumption together with assumptions like “sign of zero doesn’t matter”, which then allows things like:
x - x–>00 / x–>0x * 0–>0