FIX -fexcess-precision
authorSimon Marlow <simonmar@microsoft.com>
Sun, 8 Jul 2007 19:21:20 +0000 (19:21 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Sun, 8 Jul 2007 19:21:20 +0000 (19:21 +0000)
Ugly hack; see comments for details

compiler/main/StaticFlags.hs

index a162214..e71c5c7 100644 (file)
@@ -118,8 +118,14 @@ parseStaticFlags args = do
   let cg_flags | tablesNextToCode = ["-optc-DTABLES_NEXT_TO_CODE"]
               | otherwise        = []
 
+    -- HACK: -fexcess-precision is both a static and a dynamic flag.  If
+    -- the static flag parser has slurped it, we must return it as a 
+    -- leftover too.  ToDo: make -fexcess-precision dynamic only.
+  let excess_prec | opt_SimplExcessPrecision = ["-fexcess-precision"]
+                  | otherwise                = []
+
   when (not (null errs)) $ ghcError (UsageError (unlines errs))
-  return (cg_flags++more_leftover++leftover)
+  return (excess_prec++cg_flags++more_leftover++leftover)
 
 initStaticOpts :: IO ()
 initStaticOpts = writeIORef v_opt_C_ready True