Dear all,

This is part of a sequence of three (trivial) patches to allow Clang to be used as a drop-in replacement for GCC with the Freescale SDK.
Support for Freescale processors has just been added to the PowerPC backend.

Please review and commit if this is OK - I don't have commit access.

Thanks!
Tobias

Description of patch:

If vendor==Freescale, set fp-contract=fast unless specified otherwise. This is the default in GCC on Freescale targets.

--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -1007,6 +1009,13 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
     CmdArgs.push_back("-target-cpu");
     CmdArgs.push_back(Args.MakeArgString(TargetCPUName.c_str()));
   }
+
+  // GCC defaults to FMA fusion, so behave the same way unless the user
+  // tells us to use a different FP contract.
+  if (Triple.getVendor() == llvm::Triple::Freescale &&
+      !Args.hasArg(options::OPT_ffp_contract)) {
+    CmdArgs.push_back(Args.MakeArgString("-ffp-contract=fast"));
+  }
 }
 
 void Clang::AddSparcTargetArgs(const ArgList &Args,

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to