diff options
Diffstat (limited to 'gnu/llvm/clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | gnu/llvm/clang/lib/Frontend/CompilerInstance.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gnu/llvm/clang/lib/Frontend/CompilerInstance.cpp b/gnu/llvm/clang/lib/Frontend/CompilerInstance.cpp index 688f21dd090..c9a65bc0ec1 100644 --- a/gnu/llvm/clang/lib/Frontend/CompilerInstance.cpp +++ b/gnu/llvm/clang/lib/Frontend/CompilerInstance.cpp @@ -927,6 +927,19 @@ bool CompilerInstance::ExecuteAction(FrontendAction &Act) { setAuxTarget(TargetInfo::CreateTargetInfo(getDiagnostics(), TO)); } + if (!getTarget().hasStrictFP() && !getLangOpts().ExpStrictFP) { + if (getLangOpts().getFPRoundingMode() != + LangOptions::FPR_ToNearest) { + getDiagnostics().Report(diag::warn_fe_backend_unsupported_fp_rounding); + getLangOpts().setFPRoundingMode(LangOptions::FPR_ToNearest); + } + if (getLangOpts().getFPExceptionMode() != LangOptions::FPE_Ignore) { + getDiagnostics().Report(diag::warn_fe_backend_unsupported_fp_exceptions); + getLangOpts().setFPExceptionMode(LangOptions::FPE_Ignore); + } + // FIXME: can we disable FEnvAccess? + } + // Inform the target of the language options. // // FIXME: We shouldn't need to do this, the target should be immutable once |