Index: include/clang/Frontend/CodeGenOptions.h
===================================================================
--- include/clang/Frontend/CodeGenOptions.h	(revision 158832)
+++ include/clang/Frontend/CodeGenOptions.h	(working copy)
@@ -45,6 +45,8 @@
   };
 
   unsigned AsmVerbose        : 1; ///< -dA, -fverbose-asm.
+  unsigned AllowExcessFPPrecision : 1; ///< Allow FP ops to store intermediate
+                                       ///< results in higher precision.
   unsigned ObjCAutoRefCountExceptions : 1; ///< Whether ARC should be EH-safe.
   unsigned CUDAIsDevice      : 1; ///< Set when compiling for CUDA device.
   unsigned CXAAtExit         : 1; ///< Use __cxa_atexit for calling destructors.
Index: include/clang/Driver/Options.td
===================================================================
--- include/clang/Driver/Options.td	(revision 158832)
+++ include/clang/Driver/Options.td	(working copy)
@@ -403,6 +403,8 @@
 def fno_honor_infinites : Flag<"-fno-honor-infinites">, Alias<fno_honor_infinities>;
 def ftrapping_math : Flag<"-ftrapping-math">, Group<f_Group>;
 def fno_trapping_math : Flag<"-fno-trapping-math">, Group<f_Group>;
+def fexcess_precision : Joined<"-fexcess-precision=">, Group<f_Group>,
+                        Flags<[CC1Option]>;
 
 def ffor_scope : Flag<"-ffor-scope">, Group<f_Group>;
 def fno_for_scope : Flag<"-fno-for-scope">, Group<f_Group>;
Index: lib/Frontend/CompilerInvocation.cpp
===================================================================
--- lib/Frontend/CompilerInvocation.cpp	(revision 158832)
+++ lib/Frontend/CompilerInvocation.cpp	(working copy)
@@ -1241,6 +1241,20 @@
     Val.getAsInteger(10, Opts.StackAlignment);
   }
 
+  if (Arg *A = Args.getLastArg(OPT_fexcess_precision)) {
+    StringRef Val = A->getValue(Args);
+    if (Val == "fast") {
+      Opts.AllowExcessFPPrecision = true;
+    } else if (Val == "standard") {
+      // Currently nothing to do. Should eventually enable FP_CONTRACT support.
+    } else if (Val == "strict") {
+      // Currently nothing to do. Should eventually disable FP_CONTRACT support.
+    } else {
+      Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Val;
+      Success = false;
+    }
+  }
+
   if (Arg *A = Args.getLastArg(OPT_fobjc_dispatch_method_EQ)) {
     StringRef Name = A->getValue(Args);
     unsigned Method = llvm::StringSwitch<unsigned>(Name)
Index: lib/Driver/Tools.cpp
===================================================================
--- lib/Driver/Tools.cpp	(revision 158832)
+++ lib/Driver/Tools.cpp	(working copy)
@@ -1762,6 +1762,17 @@
       !TrappingMath)
     CmdArgs.push_back("-menable-unsafe-fp-math");
 
+  // Validate and pass through -fexcess-precision option. 
+  if (Arg *A = Args.getLastArg(options::OPT_fexcess_precision)) {
+    StringRef Val = A->getValue(Args);
+    if (Val == "fast" || Val == "standard" || Val == "strict") {
+      CmdArgs.push_back(Args.MakeArgString("-fexcess-precision=" + Val));
+    } else {
+      D.Diag(diag::err_drv_unsupported_option_argument)
+        << A->getOption().getName() << Val;
+    }
+  }
+
   // We separately look for the '-ffast-math' flag, and if we find it, tell the
   // frontend to provide the appropriate preprocessor macros. This is distinct
   // from enabling any optimizations as it induces a language change which must
Index: lib/CodeGen/BackendUtil.cpp
===================================================================
--- lib/CodeGen/BackendUtil.cpp	(revision 158832)
+++ lib/CodeGen/BackendUtil.cpp	(working copy)
@@ -355,6 +355,7 @@
   Options.NoInfsFPMath = CodeGenOpts.NoInfsFPMath;
   Options.NoNaNsFPMath = CodeGenOpts.NoNaNsFPMath;
   Options.NoZerosInBSS = CodeGenOpts.NoZeroInitializedInBSS;
+  Options.AllowExcessFPPrecision = CodeGenOpts.AllowExcessFPPrecision;
   Options.UnsafeFPMath = CodeGenOpts.UnsafeFPMath;
   Options.UseSoftFloat = CodeGenOpts.SoftFloat;
   Options.StackAlignmentOverride = CodeGenOpts.StackAlignment;
