Index: clang/lib/CodeGen/CodeGenModule.cpp =================================================================== --- clang/lib/CodeGen/CodeGenModule.cpp +++ clang/lib/CodeGen/CodeGenModule.cpp @@ -2128,15 +2128,6 @@ } } -void CodeGenModule::setLLVMFunctionFEnvAttributes(const FunctionDecl *D, - llvm::Function *F) { - if (D->hasAttr()) { - llvm::AttrBuilder FuncAttrs(F->getContext()); - FuncAttrs.addAttribute("strictfp"); - F->addFnAttrs(FuncAttrs); - } -} - void CodeGenModule::SetCommonAttributes(GlobalDecl GD, llvm::GlobalValue *GV) { const Decl *D = GD.getDecl(); if (isa_and_nonnull(D)) @@ -5330,9 +5321,6 @@ maybeSetTrivialComdat(*D, *Fn); - // Set CodeGen attributes that represent floating point environment. - setLLVMFunctionFEnvAttributes(D, Fn); - CodeGenFunction(*this).GenerateCode(GD, Fn, FI); setNonAliasAttributes(GD, Fn); Index: clang/test/CodeGen/fp-floatcontrol-stack.cpp =================================================================== --- clang/test/CodeGen/fp-floatcontrol-stack.cpp +++ clang/test/CodeGen/fp-floatcontrol-stack.cpp @@ -284,3 +284,6 @@ // CHECK-FAST: Function Attrs: noinline nounwind{{$$}} // CHECK-NOHONOR: Function Attrs: noinline nounwind{{$$}} // CHECK-LABEL: define{{.*}} @_GLOBAL__sub_I_fp_floatcontrol_stack + +// CHECK-DEBSTRICT: {{[ ]}}strictfp{{[ ]}} +// CHECK-DEBSTRICT-NOT: "strictfp"