[commit: ghc] ghc-parmake-gsoc: Retain boot modules in getModLoop (a2e338f)

git at git.haskell.org git at git.haskell.org
Sat Aug 31 02:27:08 CEST 2013


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-parmake-gsoc
Link       : http://ghc.haskell.org/trac/ghc/changeset/a2e338f3ae5a101d333fb260ed58ec238106e88e/ghc

>---------------------------------------------------------------

commit a2e338f3ae5a101d333fb260ed58ec238106e88e
Author: Patrick Palka <patrick at parcs.ath.cx>
Date:   Fri Aug 30 18:59:01 2013 -0400

    Retain boot modules in getModLoop
    
    The parallel upsweep needs to know about _all_ the modules that make up
    a module loop in order to correctly determine a module's external loop
    dependencies. Otherwise, incorrect dependency information may be
    computed, resulting in an eventual deadlock during compilation.
    
    So don't filter boot modules in getModLoop, and instead have its callers
    filter them when needed.
    
    Following this change, GHC could compile itself via --make -O2 -j. Yay!


>---------------------------------------------------------------

a2e338f3ae5a101d333fb260ed58ec238106e88e
 compiler/main/GhcMake.hs |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/compiler/main/GhcMake.hs b/compiler/main/GhcMake.hs
index 3581aa0..e69efdf 100644
--- a/compiler/main/GhcMake.hs
+++ b/compiler/main/GhcMake.hs
@@ -1303,7 +1303,8 @@ Following this fix, GHC can compile itself with --make -O2.
 reTypecheckLoop :: HscEnv -> ModSummary -> ModuleGraph -> IO HscEnv
 reTypecheckLoop hsc_env ms graph
   | Just loop <- getModLoop ms graph
-  = typecheckLoop (hsc_dflags hsc_env) hsc_env (map ms_mod_name loop)
+  , let non_boot = filter (not.isBootSummary) loop
+  = typecheckLoop (hsc_dflags hsc_env) hsc_env (map ms_mod_name non_boot)
   | otherwise
   = return hsc_env
 
@@ -1312,8 +1313,7 @@ getModLoop ms graph
   | not (isBootSummary ms)
   , any (\m -> ms_mod m == this_mod && isBootSummary m) graph
   , let mss = reachableBackwards (ms_mod_name ms) graph
-  , let non_boot = filter (not.isBootSummary) mss
-  = Just non_boot
+  = Just mss
   | otherwise
   = Nothing
  where





More information about the ghc-commits mailing list