[PATCH] D147733: Set rounding_mode to tonearest in presence of a #pragma STDC FENV_ACCESS OFF.

Andy Kaylor via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 7 09:54:06 PDT 2023


andrew.w.kaylor added inline comments.


================
Comment at: clang/lib/Sema/SemaAttr.cpp:1340
+  if (!IsEnabled)
+    NewFPFeatures.setDisallowFenvAccess(IsEnabled);
   FpPragmaStack.Act(Loc, PSK_Set, StringRef(), NewFPFeatures);
----------------
Why is this only needed for "!IsEnabled"? Where is the rounding mode set in the IsEnabled case? It looks like setAllowFEnvAccessOverride() is defined by a macro and just sets a bit in the OverrideMask, but somehow it seems to be setting the rounding mode to Round.Dynamic. I'm just concerned that there is a disconnect in the implementation here.


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

https://reviews.llvm.org/D147733



More information about the cfe-commits mailing list