From 28a5c73a83e8f27c31cad02da07c81e4e6764303 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Fri, 11 Jul 2008 12:31:51 +0000 Subject: [PATCH] Move -fno-cse flags from Makefile into pragmas These are needed for GLOBAL_VAR's to work properly --- compiler/Makefile | 12 ------------ compiler/ghci/GhciMonad.hs | 3 +++ compiler/ghci/InteractiveUI.hs | 3 +++ compiler/ghci/Linker.lhs | 3 +++ compiler/main/DriverMkDepend.hs | 2 ++ compiler/main/DriverPipeline.hs | 3 +++ compiler/main/StaticFlags.hs | 3 +++ compiler/main/SysTools.lhs | 3 +++ 8 files changed, 20 insertions(+), 12 deletions(-) diff --git a/compiler/Makefile b/compiler/Makefile index 6385c77..536f246 100644 --- a/compiler/Makefile +++ b/compiler/Makefile @@ -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 diff --git a/compiler/ghci/GhciMonad.hs b/compiler/ghci/GhciMonad.hs index 2c5a0a5..3dcdce1 100644 --- a/compiler/ghci/GhciMonad.hs +++ b/compiler/ghci/GhciMonad.hs @@ -1,3 +1,6 @@ +{-# OPTIONS -fno-cse #-} +-- -fno-cse is needed for GLOBAL_VAR's to behave properly + ----------------------------------------------------------------------------- -- -- Monadery code used in InteractiveUI diff --git a/compiler/ghci/InteractiveUI.hs b/compiler/ghci/InteractiveUI.hs index 2e474be..f88fe44 100644 --- a/compiler/ghci/InteractiveUI.hs +++ b/compiler/ghci/InteractiveUI.hs @@ -1,3 +1,6 @@ +{-# OPTIONS -fno-cse #-} +-- -fno-cse is needed for GLOBAL_VAR's to behave properly + {-# OPTIONS -#include "Linker.h" #-} ----------------------------------------------------------------------------- -- diff --git a/compiler/ghci/Linker.lhs b/compiler/ghci/Linker.lhs index ac92975..c566b8f 100644 --- a/compiler/ghci/Linker.lhs +++ b/compiler/ghci/Linker.lhs @@ -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, diff --git a/compiler/main/DriverMkDepend.hs b/compiler/main/DriverMkDepend.hs index 795a469..ffb89c1 100644 --- a/compiler/main/DriverMkDepend.hs +++ b/compiler/main/DriverMkDepend.hs @@ -1,3 +1,5 @@ +{-# OPTIONS -fno-cse #-} +-- -fno-cse is needed for GLOBAL_VAR's to behave properly ----------------------------------------------------------------------------- -- diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index 0db12cd..9b0cd0e 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -1,3 +1,6 @@ +{-# OPTIONS -fno-cse #-} +-- -fno-cse is needed for GLOBAL_VAR's to behave properly + ----------------------------------------------------------------------------- -- -- GHC Driver diff --git a/compiler/main/StaticFlags.hs b/compiler/main/StaticFlags.hs index f531a16..499367d 100644 --- a/compiler/main/StaticFlags.hs +++ b/compiler/main/StaticFlags.hs @@ -1,3 +1,6 @@ +{-# OPTIONS -fno-cse #-} +-- -fno-cse is needed for GLOBAL_VAR's to behave properly + ----------------------------------------------------------------------------- -- -- Static flags diff --git a/compiler/main/SysTools.lhs b/compiler/main/SysTools.lhs index 006dd28..6dfcd4b 100644 --- a/compiler/main/SysTools.lhs +++ b/compiler/main/SysTools.lhs @@ -7,6 +7,9 @@ ----------------------------------------------------------------------------- \begin{code} +{-# OPTIONS -fno-cse #-} +-- -fno-cse is needed for GLOBAL_VAR's to behave properly + module SysTools ( -- Initialisation initSysTools, -- 1.7.10.4