Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : tc-untouchables

http://hackage.haskell.org/trac/ghc/changeset/b0db9308017fc14b600b3a85d9c55a037f12ee9e

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

commit b0db9308017fc14b600b3a85d9c55a037f12ee9e
Merge: 633dd55... 8c3b9ac...
Author: Simon Peyton Jones <[email protected]>
Date:   Mon Sep 17 13:09:22 2012 +0100

    Merge remote-tracking branch 'origin/master' into tc-untouchables
    
    Conflicts:
        compiler/typecheck/TcMType.lhs
        compiler/typecheck/TcSMonad.lhs

 aclocal.m4                                         |    5 +-
 compiler/cmm/Bitmap.hs                             |   43 +-
 compiler/cmm/CLabel.hs                             |   33 +-
 compiler/cmm/CmmBuildInfoTables.hs                 |   59 +-
 compiler/cmm/CmmCallConv.hs                        |   86 +-
 compiler/cmm/CmmExpr.hs                            |  174 ++--
 compiler/cmm/CmmInfo.hs                            |   56 +-
 compiler/cmm/CmmLayoutStack.hs                     |  169 ++--
 compiler/cmm/CmmLint.hs                            |   76 +-
 compiler/cmm/CmmMachOp.hs                          |  153 ++--
 compiler/cmm/CmmNode.hs                            |    9 +-
 compiler/cmm/CmmOpt.hs                             |   85 +-
 compiler/cmm/CmmParse.y                            |   42 +-
 compiler/cmm/CmmPipeline.hs                        |    9 +-
 compiler/cmm/CmmRewriteAssignments.hs              |   46 +-
 compiler/cmm/CmmSink.hs                            |   40 +-
 compiler/cmm/CmmType.hs                            |   44 +-
 compiler/cmm/CmmUtils.hs                           |  329 ++++----
 compiler/cmm/MkGraph.hs                            |   10 +-
 compiler/cmm/OldCmmLint.hs                         |  115 ++--
 compiler/cmm/OldCmmUtils.hs                        |   17 +-
 compiler/cmm/OldPprCmm.hs                          |    7 +-
 compiler/cmm/PprC.hs                               |  207 +++---
 compiler/cmm/PprCmm.hs                             |    3 +-
 compiler/cmm/PprCmmExpr.hs                         |   10 +-
 compiler/cmm/SMRep.lhs                             |   17 +-
 compiler/codeGen/CgBindery.lhs                     |  133 ++--
 compiler/codeGen/CgCallConv.hs                     |   89 ++-
 compiler/codeGen/CgCase.lhs                        |   13 +-
 compiler/codeGen/CgClosure.lhs                     |   49 +-
 compiler/codeGen/CgCon.lhs                         |   42 +-
 compiler/codeGen/CgExpr.lhs                        |   24 +-
 compiler/codeGen/CgForeignCall.hs                  |   97 ++--
 compiler/codeGen/CgHeapery.lhs                     |  128 ++--
 compiler/codeGen/CgHpc.hs                          |    3 +-
 compiler/codeGen/CgInfoTbls.hs                     |   88 +-
 compiler/codeGen/CgLetNoEscape.lhs                 |    5 +-
 compiler/codeGen/CgPrimOp.hs                       |  841 ++++++++++----------
 compiler/codeGen/CgProf.hs                         |  178 ++--
 compiler/codeGen/CgStackery.lhs                    |   40 +-
 compiler/codeGen/CgTailCall.lhs                    |   15 +-
 compiler/codeGen/CgTicky.hs                        |   57 +-
 compiler/codeGen/CgUtils.hs                        |  331 ++++----
 compiler/codeGen/ClosureInfo.lhs                   |   58 +-
 compiler/codeGen/CodeGen.lhs                       |    3 +-
 compiler/codeGen/StgCmm.hs                         |   10 +-
 compiler/codeGen/StgCmmBind.hs                     |   41 +-
 compiler/codeGen/StgCmmClosure.hs                  |   35 +-
 compiler/codeGen/StgCmmCon.hs                      |   50 +-
 compiler/codeGen/StgCmmEnv.hs                      |   63 +-
 compiler/codeGen/StgCmmExpr.hs                     |   70 +-
 compiler/codeGen/StgCmmForeign.hs                  |  111 ++--
 compiler/codeGen/StgCmmHeap.hs                     |   91 +-
 compiler/codeGen/StgCmmHpc.hs                      |   21 +-
 compiler/codeGen/StgCmmLayout.hs                   |   98 ++--
 compiler/codeGen/StgCmmMonad.hs                    |   41 +-
 compiler/codeGen/StgCmmPrim.hs                     |  859 ++++++++++----------
 compiler/codeGen/StgCmmProf.hs                     |  159 ++--
 compiler/codeGen/StgCmmTicky.hs                    |   52 +-
 compiler/codeGen/StgCmmUtils.hs                    |  184 +++--
 compiler/coreSyn/MkExternalCore.lhs                |    3 +-
 compiler/deSugar/Coverage.lhs                      |   15 +-
 compiler/deSugar/Desugar.lhs                       |    5 +-
 compiler/deSugar/DsCCall.lhs                       |   14 +-
 compiler/deSugar/DsForeign.lhs                     |   42 +-
 compiler/ghc.cabal.in                              |    3 +-
 compiler/ghc.mk                                    |   27 +-
 compiler/ghci/ByteCodeAsm.lhs                      |   67 +-
 compiler/ghci/ByteCodeGen.lhs                      |  128 ++--
 compiler/ghci/ByteCodeItbls.lhs                    |   57 +-
 compiler/ghci/ByteCodeLink.lhs                     |   39 +-
 compiler/ghci/DebuggerUtils.hs                     |    3 +-
 compiler/ghci/LibFFI.hsc                           |   21 +-
 compiler/ghci/Linker.lhs                           |   25 +-
 compiler/ghci/RtClosureInspect.hs                  |   27 +-
 compiler/iface/BinIface.hs                         |    4 +-
 compiler/iface/IfaceSyn.lhs                        |   22 +
 compiler/iface/MkIface.lhs                         |   17 +-
 compiler/llvmGen/Llvm/Types.hs                     |   34 +-
 compiler/llvmGen/LlvmCodeGen.hs                    |    2 +-
 compiler/llvmGen/LlvmCodeGen/Base.hs               |   51 +-
 compiler/llvmGen/LlvmCodeGen/CodeGen.hs            |  163 +++--
 compiler/llvmGen/LlvmCodeGen/Data.hs               |   22 +-
 compiler/llvmGen/LlvmCodeGen/Ppr.hs                |    9 +-
 compiler/llvmGen/LlvmCodeGen/Regs.hs               |   17 +-
 compiler/main/BreakArray.hs                        |   46 +-
 compiler/main/CodeOutput.lhs                       |    2 +-
 compiler/main/DriverPipeline.hs                    |  290 ++++----
 compiler/main/DynFlags.hs                          |  312 +++++++-
 compiler/main/HscMain.hs                           |    4 +-
 compiler/main/HscTypes.lhs                         |   34 +-
 compiler/main/InteractiveEval.hs                   |    3 +-
 compiler/main/Packages.lhs                         |   15 +-
 compiler/main/StaticFlagParser.hs                  |   47 +-
 compiler/main/StaticFlags.hs                       |  249 +------
 compiler/main/SysTools.lhs                         |   11 +-
 compiler/main/TidyPgm.lhs                          |   25 +-
 compiler/nativeGen/AsmCodeGen.lhs                  |   22 +-
 compiler/nativeGen/Instruction.hs                  |    5 +-
 compiler/nativeGen/PIC.hs                          |   60 +-
 compiler/nativeGen/PPC/CodeGen.hs                  |   62 +-
 compiler/nativeGen/PPC/Instr.hs                    |   29 +-
 compiler/nativeGen/PPC/Ppr.hs                      |   40 +-
 compiler/nativeGen/PPC/Regs.hs                     |    7 +-
 compiler/nativeGen/RegAlloc/Graph/Main.hs          |    2 +-
 compiler/nativeGen/RegAlloc/Linear/Base.hs         |   10 +-
 compiler/nativeGen/RegAlloc/Linear/FreeRegs.hs     |   28 +-
 .../nativeGen/RegAlloc/Linear/JoinToTargets.hs     |  434 +++++-----
 compiler/nativeGen/RegAlloc/Linear/Main.hs         |  214 +++---
 compiler/nativeGen/RegAlloc/Linear/StackMap.hs     |    6 +-
 compiler/nativeGen/RegAlloc/Linear/State.hs        |  121 ++--
 compiler/nativeGen/RegAlloc/Linear/X86/FreeRegs.hs |   27 +-
 .../RegAlloc/Linear/{X86 => X86_64}/FreeRegs.hs    |   30 +-
 compiler/nativeGen/RegAlloc/Liveness.hs            |   15 +-
 compiler/nativeGen/SPARC/Base.hs                   |    6 +-
 compiler/nativeGen/SPARC/CodeGen.hs                |   31 +-
 compiler/nativeGen/SPARC/CodeGen/Amode.hs          |    3 +-
 compiler/nativeGen/SPARC/CodeGen/Base.hs           |    9 +-
 compiler/nativeGen/SPARC/CodeGen/CondCode.hs       |    5 +-
 compiler/nativeGen/SPARC/CodeGen/Gen32.hs          |   12 +-
 compiler/nativeGen/SPARC/Instr.hs                  |   17 +-
 compiler/nativeGen/SPARC/Ppr.hs                    |   40 +-
 compiler/nativeGen/SPARC/Stack.hs                  |   15 +-
 compiler/nativeGen/X86/CodeGen.hs                  |  191 +++---
 compiler/nativeGen/X86/Instr.hs                    |   53 +-
 compiler/nativeGen/X86/Ppr.hs                      |   10 +-
 compiler/nativeGen/X86/Regs.hs                     |   17 +-
 compiler/parser/Lexer.x                            |    7 +-
 compiler/parser/Parser.y.pp                        |   18 +-
 compiler/simplCore/CoreMonad.lhs                   |   14 +-
 compiler/simplCore/SimplMonad.lhs                  |    6 +-
 compiler/simplStg/SRT.lhs                          |  101 ++--
 compiler/simplStg/SimplStg.lhs                     |    2 +-
 compiler/simplStg/UnariseStg.lhs                   |  152 +++--
 compiler/stgSyn/CoreToStg.lhs                      |   11 +-
 compiler/stgSyn/StgSyn.lhs                         |    4 +-
 compiler/typecheck/TcDeriv.lhs                     |    3 +-
 compiler/typecheck/TcEvidence.lhs                  |   29 +-
 compiler/typecheck/TcGenDeriv.lhs                  |    9 +-
 compiler/typecheck/TcHsType.lhs                    |   15 +-
 compiler/typecheck/TcMType.lhs                     |   23 +-
 compiler/typecheck/TcSMonad.lhs                    |   26 +-
 compiler/typecheck/TcTyClsDecls.lhs                |   29 +-
 compiler/typecheck/TcUnify.lhs                     |   20 +-
 compiler/types/TyCon.lhs                           |   21 +-
 compiler/types/Type.lhs                            |   16 +-
 compiler/utils/Platform.hs                         |    4 +
 docs/users_guide/flags.xml                         |    4 +-
 docs/users_guide/ghci.xml                          |   29 +-
 docs/users_guide/glasgow_exts.xml                  |    2 +-
 ghc/InteractiveUI.hs                               |   22 +-
 ghc/Main.hs                                        |   24 +-
 ghc/ghc-bin.cabal.in                               |    2 +-
 ghc/ghc.mk                                         |   13 +-
 ghc/hschooks.c                                     |    2 +-
 includes/HaskellConstants.hs                       |  149 ----
 includes/ghc.mk                                    |   59 +-
 includes/mkDerivedConstants.c                      |  426 ++++++++---
 includes/rts/Hooks.h                               |    6 +-
 includes/rts/SpinLock.h                            |    2 +-
 includes/rts/Threads.h                             |    8 +-
 includes/rts/Types.h                               |    6 +-
 includes/rts/storage/Block.h                       |    4 +-
 includes/rts/storage/ClosureMacros.h               |    8 +-
 includes/rts/storage/GC.h                          |   12 +-
 includes/rts/storage/MBlock.h                      |    6 +-
 includes/stg/Types.h                               |   18 +-
 rts/Arena.c                                        |    2 +-
 rts/Capability.h                                   |    2 +-
 rts/Disassembler.c                                 |    2 +-
 rts/FrontPanel.c                                   |    2 +-
 rts/FrontPanel.h                                   |    2 +-
 rts/GetTime.h                                      |    2 +-
 rts/Linker.c                                       |    8 +-
 rts/Messages.c                                     |   10 +-
 rts/Printer.c                                      |   27 +-
 rts/ProfHeap.c                                     |    2 +-
 rts/Profiling.c                                    |    2 +-
 rts/RetainerProfile.c                              |    4 +-
 rts/RetainerProfile.h                              |    2 +-
 rts/RtsAPI.c                                       |    6 +-
 rts/RtsFlags.c                                     |    2 +-
 rts/RtsUtils.c                                     |    2 +-
 rts/Schedule.c                                     |    4 +-
 rts/Stats.c                                        |   44 +-
 rts/Stats.h                                        |    4 +-
 rts/Threads.c                                      |   16 +-
 rts/Threads.h                                      |    2 +-
 rts/Trace.c                                        |   68 +-
 rts/Trace.h                                        |   44 +-
 rts/eventlog/EventLog.c                            |   20 +-
 rts/eventlog/EventLog.h                            |   20 +-
 rts/hooks/MallocFail.c                             |    4 +-
 rts/hooks/OutOfHeap.c                              |    4 +-
 rts/hooks/StackOverflow.c                          |    4 +-
 rts/package.conf.in                                |    2 +-
 rts/parallel/ParTicky.c                            |    4 +-
 rts/posix/GetTime.c                                |    2 +-
 rts/posix/OSMem.c                                  |   16 +-
 rts/sm/BlockAlloc.c                                |   80 ++-
 rts/sm/BlockAlloc.h                                |   12 +-
 rts/sm/Compact.c                                   |   16 +-
 rts/sm/Evac.h                                      |    2 +-
 rts/sm/GC.c                                        |   38 +-
 rts/sm/GCThread.h                                  |   18 +-
 rts/sm/GCUtils.c                                   |    2 +-
 rts/sm/MBlock.c                                    |    6 +-
 rts/sm/OSMem.h                                     |    4 +-
 rts/sm/Sanity.c                                    |   28 +-
 rts/sm/Scav.c                                      |    8 +-
 rts/sm/Storage.c                                   |   86 +-
 rts/sm/Storage.h                                   |   30 +-
 rts/sm/Sweep.c                                     |    2 +-
 rts/win32/GetTime.c                                |    2 +-
 rts/win32/OSMem.c                                  |   30 +-
 sync-all                                           |    7 +-
 utils/ghc-cabal/ghc-cabal.cabal                    |    2 +-
 utils/ghc-pkg/ghc-pkg.cabal                        |    2 +-
 utils/ghc-pwd/ghc-pwd.cabal                        |    2 +-
 utils/hpc/hpc-bin.cabal                            |    2 +-
 utils/runghc/runghc.cabal.in                       |    2 +-
 221 files changed, 5919 insertions(+), 5408 deletions(-)

diff --cc compiler/typecheck/TcMType.lhs
index 7a88420,67ed967..2e0c04f
--- a/compiler/typecheck/TcMType.lhs
+++ b/compiler/typecheck/TcMType.lhs
@@@ -618,17 -593,17 +618,20 @@@ skolemiseSigTv t
  
  \begin{code}
  zonkImplication :: Implication -> TcM Implication
 -zonkImplication implic@(Implic { ic_skols  = skols
 -                               , ic_given = given 
 +zonkImplication implic@(Implic { ic_untch  = untch
 +                               , ic_binds  = binds_var
++                               , ic_skols  = skols
 +                               , ic_given  = given
                                 , ic_wanted = wanted
                                 , ic_loc = loc })
-   = do {    -- No need to zonk the skolems
+   = do { skols'  <- mapM zonkTcTyVarBndr skols  -- Need to zonk their kinds!
+                                                 -- as Trac #7230 showed
         ; given'  <- mapM zonkEvVar given
         ; loc'    <- zonkGivenLoc loc
 -       ; wanted' <- zonkWC wanted
 +       ; wanted' <- zonkWCRec binds_var untch wanted
-        ; return (implic { ic_given = given'
+        ; return (implic { ic_skols = skols'
+                         , ic_given = given'
 +                        , ic_fsks  = []  -- Zonking removes all FlatSkol 
tyvars
                          , ic_wanted = wanted'
                          , ic_loc = loc' }) }
  
diff --cc compiler/typecheck/TcSMonad.lhs
index 0e7233c,f6f1c78..8ee2178
--- a/compiler/typecheck/TcSMonad.lhs
+++ b/compiler/typecheck/TcSMonad.lhs
@@@ -1453,25 -1497,29 +1467,18 @@@ xCtFlavor :: CtEvidence              -
            -> [TcPredType]          -- New predicate types
            -> XEvTerm               -- Instructions about how to manipulate 
evidence
            -> TcS [CtEvidence]
 -xCtFlavor = xCtFlavor_cache True          
 -
 -xCtFlavor_cache :: Bool            -- True = if wanted add to the solved bag! 
   
 -          -> CtEvidence            -- Original flavor   
 -          -> [TcPredType]          -- New predicate types
 -          -> XEvTerm               -- Instructions about how to manipulate 
evidence
 -          -> TcS [CtEvidence]
  
 -xCtFlavor_cache _ (Given { ctev_gloc = gl, ctev_evtm = tm }) ptys xev
 +xCtFlavor (CtGiven { ctev_gloc = gl, ctev_evtm = tm }) ptys xev
    = ASSERT( equalLength ptys (ev_decomp xev tm) )
      zipWithM (newGivenEvVar gl) ptys (ev_decomp xev tm)
-     -- For Givens we make new EvVars and bind them immediately. We don't worry
-     -- about caching, but we don't expect complicated calculations among 
Givens.
-     -- It is important to bind each given:
-     --       class (a~b) => C a b where ....
-     --       f :: C a b => ....
-     -- Then in f's Givens we have g:(C a b) and the superclass sc(g,0):a~b.
-     -- But that superclass selector can't (yet) appear in a coercion
-     -- (see evTermCoercion), so the easy thing is to bind it to an Id
+     -- See Note [Bind new Givens immediately]
    
 -xCtFlavor_cache cache ctev@(Wanted { ctev_wloc = wl, ctev_evar = evar }) ptys 
xev
 +xCtFlavor ctev@(CtWanted { ctev_wloc = wl, ctev_evar = evar }) ptys xev
    = do { new_evars <- mapM (newWantedEvVar wl) ptys
         ; setEvBind evar (ev_comp xev (getEvTerms new_evars))
 -
 -           -- Add the now-solved wanted constraint to the cache
 -       ; when cache $ addToSolved ctev
 -
         ; return (freshGoals new_evars) }
      
 -xCtFlavor_cache _ (Derived { ctev_wloc = wl }) ptys _xev
 +xCtFlavor (CtDerived { ctev_wloc = wl }) ptys _xev
    = do { ders <- mapM (newDerived wl) ptys
         ; return (catMaybes ders) }
  
@@@ -1506,12 -1553,22 +1513,13 @@@ Main purpose: create new evidence for n
  -- If derived, don't even look at the coercion
  -- NB: this allows us to sneak away with ``error'' thunks for 
  -- coercions that come from derived ids (which don't exist!) 
 -rewriteCtFlavor_cache _cache (Derived { ctev_wloc = wl }) pty_new _co
 +
 +rewriteCtFlavor (CtDerived { ctev_wloc = wl }) pty_new _co
    = newDerived wl pty_new
          
 -rewriteCtFlavor_cache _cache (Given { ctev_gloc = gl, ctev_evtm = old_tm }) 
pty_new co
 +rewriteCtFlavor (CtGiven { ctev_gloc = gl, ctev_evtm = old_tm }) pty_new co
-   = return (Just (CtGiven { ctev_gloc = gl, ctev_pred = pty_new, ctev_evtm = 
new_tm }))
+   = do { new_ev <- newGivenEvVar gl pty_new new_tm  -- See Note [Bind new 
Givens immediately]
+        ; return (Just new_ev) }
    where
      new_tm = mkEvCast old_tm (mkTcSymCo co)  -- mkEvCase optimises ReflCo
    



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to