Index: clang/lib/Sema/SemaAttr.cpp =================================================================== --- clang/lib/Sema/SemaAttr.cpp +++ clang/lib/Sema/SemaAttr.cpp @@ -1336,6 +1336,7 @@ Diag(Loc, diag::err_pragma_fenv_requires_precise); } NewFPFeatures.setAllowFEnvAccessOverride(IsEnabled); + NewFPFeatures.setRoundingMathOverride(IsEnabled); FpPragmaStack.Act(Loc, PSK_Set, StringRef(), NewFPFeatures); CurFPFeatures = NewFPFeatures.applyOverrides(getLangOpts()); } Index: clang/test/CodeGen/pragma-fenv_access.c =================================================================== --- clang/test/CodeGen/pragma-fenv_access.c +++ clang/test/CodeGen/pragma-fenv_access.c @@ -224,3 +224,17 @@ // STRICT: call float @llvm.experimental.constrained.fadd.f32(float {{.*}}, float {{.*}}, metadata !"round.tonearest", metadata !"fpexcept.strict") // DEFAULT: fadd float +#pragma STDC FENV_ACCESS ON +float func_19(float x, float y) { + return x + y; +} +// CHECK-LABEL: @func_19 +// STRICT: call float @llvm.experimental.constrained.fadd.f32(float %0, float %1, metadata !"round.dynamic", metadata !"fpexcept.strict") + +#pragma STDC FENV_ACCESS OFF +float func_20(float x, float y) { + return x + y; +} +// CHECK-LABEL: @func_20 +// STRICT: call float @llvm.experimental.constrained.fadd.f32(float %0, float %1, metadata !"round.tonearest", metadata !"fpexcept.strict") +// DEFAULT: fadd float