[PATCH] D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled.

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 10 12:41:42 PST 2022


aaron.ballman added inline comments.


================
Comment at: clang/test/CodeGen/eval-method-fast-math.c:83
+#pragma float_control(pop)
+
+int getFPEvalMethod() {
----------------
What should happen in a case like this?
```
int whatever(float a, float b, float c) {
  #pragma float_control(precise, off)
  res = a + b + c;
  int val = __FLT_EVAL_METHOD__;
  #pragma float_control(precise, on)
  return __FLT_EVAL_METHOD__;
}
```
I would expect that `int val` would hold `-1` and the return statement would return `0`?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121122/new/

https://reviews.llvm.org/D121122



More information about the cfe-commits mailing list