Closed
Description
Bugzilla Link | 43725 |
Version | 8.0 |
OS | Linux |
CC | @DougGregor,@zygoloid |
Extended Description
Is there a way to disable ALL "optimizations" related to floating-point?
My testing has shown that clang does the following:
1. * x => x
0. * x => 0.
x / 1. => x
x / x => 1.
0. / x => 0.
x + 0. => x
x - 0. => x
x - x => 0.
They are all invalid "optimizations" if x is a signaling NaN.
In addition, some are invalid if x is a signed zero or infinity.
In the above, 'x' can be either a variable or a constant.
It might matter if 'x' is float, double, or long double.