Move -fno-cse flags from Makefile into pragmas
authorIan Lynagh <igloo@earth.li>
Fri, 11 Jul 2008 12:31:51 +0000 (12:31 +0000)
committerIan Lynagh <igloo@earth.li>
Fri, 11 Jul 2008 12:31:51 +0000 (12:31 +0000)
These are needed for GLOBAL_VAR's to work properly

compiler/Makefile
compiler/ghci/GhciMonad.hs
compiler/ghci/InteractiveUI.hs
compiler/ghci/Linker.lhs
compiler/main/DriverMkDepend.hs
compiler/main/DriverPipeline.hs
compiler/main/StaticFlags.hs
compiler/main/SysTools.lhs

index 6385c77..536f246 100644 (file)
@@ -576,18 +576,6 @@ endif
 #simplCore/SimplEnv_HC_OPTS = -auto-all
 #simplCore/SimplUtils_HC_OPTS = -auto-all
 
-# CSE interacts badly with top-level IORefs (reportedly in DriverState and
-# DriverMkDepend), causing some of them to be commoned up.  We have a fix for
-# this in 5.00+, but earlier versions of the compiler will need CSE turned off.
-# To be on the safe side, we disable CSE in *all* modules with top-level IORefs.
-ghci/InteractiveUI_HC_OPTS     = -fno-cse
-main/CmdLineOpts_HC_OPTS       = -fno-cse
-main/DriverMkDepend_HC_OPTS    = -fno-cse
-main/DriverPipeline_HC_OPTS    = -fno-cse
-main/Finder_HC_OPTS            = -fno-cse
-main/SysTools_HC_OPTS          = -fno-cse
-main/StaticFlags_HC_OPTS       = -fno-cse
-
 # The #include is vital for the via-C route, else the C
 # compiler doesn't realise that the stcall foreign imports are indeed
 # stdcall, and doesn't generate the Foo@8 name for them
index 2c5a0a5..3dcdce1 100644 (file)
@@ -1,3 +1,6 @@
+{-# OPTIONS -fno-cse #-}
+-- -fno-cse is needed for GLOBAL_VAR's to behave properly
+
 -----------------------------------------------------------------------------
 --
 -- Monadery code used in InteractiveUI
index 2e474be..f88fe44 100644 (file)
@@ -1,3 +1,6 @@
+{-# OPTIONS -fno-cse #-}
+-- -fno-cse is needed for GLOBAL_VAR's to behave properly
+
 {-# OPTIONS -#include "Linker.h" #-}
 -----------------------------------------------------------------------------
 --
index ac92975..c566b8f 100644 (file)
@@ -14,6 +14,9 @@ necessary.
 \begin{code}
 {-# OPTIONS -optc-DNON_POSIX_SOURCE -#include "Linker.h" #-}
 
+{-# OPTIONS -fno-cse #-}
+-- -fno-cse is needed for GLOBAL_VAR's to behave properly
+
 module Linker ( HValue, getHValue, showLinkerState,
                linkExpr, unload, withExtendedLinkEnv,
                 extendLinkEnv, deleteFromLinkEnv,
index 795a469..ffb89c1 100644 (file)
@@ -1,3 +1,5 @@
+{-# OPTIONS -fno-cse #-}
+-- -fno-cse is needed for GLOBAL_VAR's to behave properly
 
 -----------------------------------------------------------------------------
 --
index 0db12cd..9b0cd0e 100644 (file)
@@ -1,3 +1,6 @@
+{-# OPTIONS -fno-cse #-}
+-- -fno-cse is needed for GLOBAL_VAR's to behave properly
+
 -----------------------------------------------------------------------------
 --
 -- GHC Driver
index f531a16..499367d 100644 (file)
@@ -1,3 +1,6 @@
+{-# OPTIONS -fno-cse #-}
+-- -fno-cse is needed for GLOBAL_VAR's to behave properly
+
 -----------------------------------------------------------------------------
 --
 -- Static flags
index 006dd28..6dfcd4b 100644 (file)
@@ -7,6 +7,9 @@
 -----------------------------------------------------------------------------
 
 \begin{code}
+{-# OPTIONS -fno-cse #-}
+-- -fno-cse is needed for GLOBAL_VAR's to behave properly
+
 module SysTools (
         -- Initialisation
         initSysTools,