[PATCH] D69272: Enable '#pragma STDC FENV_ACCESS' in frontend

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 7 17:08:26 PST 2020


rsmith requested changes to this revision.
rsmith added a comment.
This revision now requires changes to proceed.

I don't see any changes to the constant evaluator here. You need to properly handle constant evaluation within `FENV_ACCESS ON` contexts, somehow, or you'll miscompile floating-point operations with constant operands. Probably the easiest thing would be to treat all rounded FP operations as non-constant in an `FENV_ACCESS ON` region, though in C++ `constexpr` evaluations we could permit rounded FP operations if the evaluation began in an `FENV_ACCESS OFF` region (that way we know the computations should be done in the default FP environment because `feset*` are not `constexpr` functions).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69272





More information about the cfe-commits mailing list