[PATCH] D87528: Enable '#pragma STDC FENV_ACCESS' in frontend cf. D69272 - Work in Progress
Melanie Blower via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 22 12:27:02 PDT 2020
mibintc added inline comments.
================
Comment at: clang/lib/Sema/SemaAttr.cpp:1020-1023
+ // Resume the default rounding and exception modes.
+ NewFPFeatures.setRoundingModeOverride(
+ llvm::RoundingMode::NearestTiesToEven);
+ NewFPFeatures.setFPExceptionModeOverride(LangOptions::FPE_Ignore);
----------------
sepavloff wrote:
> The previous values of rounding mode and exception behavior may differ from the default values. For example, `#pragma STDC FENV_ROUND` may set constant rounding direction different from FE_TONEAREST`. Similarly, command line options may set exception behavior different from `ignore`.
> Can pragma stack be used for this?
> The previous values of rounding mode and exception behavior may differ from the default values. For example, `#pragma STDC FENV_ROUND` may set constant rounding direction different from FE_TONEAREST`. Similarly, command line options may set exception behavior different from `ignore`.
> Can pragma stack be used for this?
I guess I could just NewFPFeatures.setAllowFEnvAccessOverride(false); and leave the other 2 unset, does that sound right? The values of the FPFeatures are being preserved around compound statements with FPFeaturesStateRAII
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87528/new/
https://reviews.llvm.org/D87528
More information about the cfe-commits
mailing list