| Issue |
208344
|
| Summary |
`#pragma float_control(precise, on)` behavior doesn't agree with docs
|
| Labels |
|
| Assignees |
|
| Reporter |
Marc-B-Reynolds
|
Given `-ffast-math` on command line: doesn't honor infinites, NaNs, setting errno and only respects any following `#pragma clang fp contract` in limited cases (see below)
https://godbolt.org/z/4z3PMEePc
local copy:
```c
#include <math.h>
// docs claim: -ffast-math turned off, -ffp-contract=on & -fmath-errno
#pragma float_control(precise,on)
int is_ordered(float x) { return x == x; } // not respecting NaNs
int is_inf(float x) { return isinf(x); } // not respecting inf
float my_sqrt(float x) { return sqrtf(x); } // good answer IMHO but not what doc's say
// correct to documentation: fusing on
float madd0(float a, float b, float c) { return a*b+c; }
// strange case: the pragma is respect if -ffp-contract={on, off, fast-honor-pragmas}
// is on the command line. But anyway: again not agreeing with documentation.
// we should be equivalent to -ffp-contract=on at this point..so this should be respected
// by my reading.
#pragma clang fp contract(off)
float madd1(float a, float b, float c) { return a*b+c; }
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs