[PATCH] D130907: [Clang] Use pragma FENV_ROUND to reset rounding mode settings.

Serge Pavlov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 5 09:38:22 PDT 2022


sepavloff added inline comments.


================
Comment at: clang/lib/Sema/SemaStmt.cpp:398
+    // If dynamic rounding mode is specified in absence of FENV_ACCESS, treat it
+    // as setting default rounding mode.
+    FpPragmaStack.CurrentValue.clearConstRoundingModeOverride();
----------------
efriedma wrote:
> I'm not really happy with the way this is written... like I mentioned in the other patch, keep the state transitions simple, and put the logic into the code that computes the derived properties.
This is not about any floating-point property, it is only how to distinguish between the cases of user-defined properties (which must be preserved) and default ones (which may be overridden). So far the only case, where this difference is important, is the interaction of FP pragmas and template instantiations, implemented in D131143. If that change is not accepted, this one loses its value.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130907



More information about the cfe-commits mailing list