Lightweight ticky-ticky profiling
[ghc-hetmet.git] / compiler / main / DriverPipeline.hs
index 9e33f51..59f0721 100644 (file)
@@ -416,9 +416,7 @@ runPipeline stop_phase dflags (input_fn, mb_phase) output maybe_loc
   let (basename, suffix) = splitFilename input_fn
 
        -- If we were given a -x flag, then use that phase to start from
-      start_phase
-       | Just x_phase <- mb_phase = x_phase
-       | otherwise                = startPhase suffix
+      start_phase = fromMaybe (startPhase suffix) mb_phase
 
   -- We want to catch cases of "you can't get there from here" before
   -- we start the pipeline, because otherwise it will just run off the
@@ -882,6 +880,10 @@ runPhase cc_phase stop dflags basename suff input_fn get_output_fn maybe_loc
                       ++ split_opt
                       ++ include_paths
                       ++ pkg_extra_cc_opts
+#ifdef HAVE_GCC_HAS_WRAPV
+                  -- We need consistent integer overflow (trac #952)
+               ++ ["-fwrapv"]
+#endif
                       ))
 
        return (next_phase, dflags, maybe_loc, output_fn)