Changes between Initial Version and Version 2 of Ticket #4121


Ignore:
Timestamp:
Jun 14, 2010 1:40:07 PM (4 years ago)
Author:
simonpj
Comment:

Fixed by

Mon Jun 14 14:27:26 BST 2010  simonpj@microsoft.com
  * Gruesome fix in CorePrep to fix embarassing Trac #4121
  
  This is a long-lurking bug that has been flushed into
  the open by other arity-related changes.  There's a
  long comment
  
       Note [CafInfo and floating]
  
  to explain.  
  
  I really hate the contortions we have to do through to keep correct
  CafRef information on top-level binders.  The Right Thing, I believe,
  is to compute CAF and arity information later, and merge it into the
  interface-file information when the latter is generated.
  
  But for now, this hackily fixes the problem.

    M ./compiler/coreSyn/CorePrep.lhs -40 +120

However we need a more general fix; Note [CafInfo and floating] concludes

This is all very gruesome and horrible. It would be better to figure
out CafInfo later, after CorePrep.  We'll do that in due course. 
Meanwhile this horrible hack works.

So I'll re-titling the ticket.

Simon

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #4121

    • Property Summary changed from Ghc stage1 panic, ASSERT failure: libraries/base/Control/Applicative.hs to Refactor the plumbing of CafInfo to make it more robust
    • Property Milestone changed from to 6.14.1
  • Ticket #4121 – Description

    initial v2  
    1111  (GHC version 6.13 for i386-unknown-linux): 
    1212        ASSERT failed! file compiler/stgSyn/CoreToStg.lhs line 187 
    13 base:Control.Applicative.$fAlternativeSTM{v rk} [gid[DFunId]] 
    14 let { 
    15   sat_s1oj{v} [lid] 
    16     :: forall a{tv 12} [tv]. 
    17        ghc-prim:GHC.Prim.State#{(w) tc 32q} 
    18          ghc-prim:GHC.Prim.RealWorld{(w) tc 31E} 
    19        -> (# ghc-prim:GHC.Prim.State#{(w) tc 32q} 
    20                ghc-prim:GHC.Prim.RealWorld{(w) tc 31E}, 
    21              a{tv 12} [tv] #) 
    22   [LclId] 
    23   sat_s1oj{v} [lid] = 
    24     \ (@ a{tv 12} [tv]) 
    25       (eta_B1{v} [lid] 
    26          :: ghc-prim:GHC.Prim.State#{(w) tc 32q} 
    27               ghc-prim:GHC.Prim.RealWorld{(w) tc 31E}) -> 
    28       ghc-prim:GHC.Prim.retry#{(w) v 93U} [gid[PrimOp]] 
    29         @ a{tv 12} [tv] eta_B1{v} [lid] } in 
    30 base:Control.Applicative.D:Alternative{v rrp} [gid[DataCon]] 
    31   @ <nt>base:GHC.Conc.STM{tc r2r} 
    32   base:Control.Applicative.$fApplicativeSTM{v r2q} [gid[DFunId]] 
    33   (sat_s1oj{v} [lid] 
    34    `cast` (forall a{tv aIy} [tv]. 
    35            ghc-prim:GHC.Prim.sym{(w) tc 34v} 
    36              (base:GHC.Conc.NTCo:STM{tc r2m} a{tv aIy} [tv]) 
    37            :: (forall a{tv aIy} [tv]. 
    38                ghc-prim:GHC.Prim.State#{(w) tc 32q} 
    39                  ghc-prim:GHC.Prim.RealWorld{(w) tc 31E} 
    40                -> (# ghc-prim:GHC.Prim.State#{(w) tc 32q} 
    41                        ghc-prim:GHC.Prim.RealWorld{(w) tc 31E}, 
    42                      a{tv aIy} [tv] #)) 
    43                 ~ 
    44               (forall a{tv aIy} [tv]. base:GHC.Conc.STM{tc r2r} a{tv aIy} [tv]))) 
    45   (base:GHC.Conc.orElse1{v re9} [gid] 
    46    `cast` (forall a{tv aIx} [tv]. 
    47            base:GHC.Conc.STM{tc r2r} a{tv aIx} [tv] 
    48            -> base:GHC.Conc.STM{tc r2r} a{tv aIx} [tv] 
    49            -> ghc-prim:GHC.Prim.sym{(w) tc 34v} 
    50                 (base:GHC.Conc.NTCo:STM{tc r2m} a{tv aIx} [tv]) 
    51            :: (forall a{tv aIx} [tv]. 
    52                base:GHC.Conc.STM{tc r2r} a{tv aIx} [tv] 
    53                -> base:GHC.Conc.STM{tc r2r} a{tv aIx} [tv] 
    54                -> ghc-prim:GHC.Prim.State#{(w) tc 32q} 
    55                     ghc-prim:GHC.Prim.RealWorld{(w) tc 31E} 
    56                -> (# ghc-prim:GHC.Prim.State#{(w) tc 32q} 
    57                        ghc-prim:GHC.Prim.RealWorld{(w) tc 31E}, 
    58                      a{tv aIx} [tv] #)) 
    59                 ~ 
    60               (forall a{tv aIx} [tv]. 
    61                base:GHC.Conc.STM{tc r2r} a{tv aIx} [tv] 
    62                -> base:GHC.Conc.STM{tc r2r} a{tv aIx} [tv] 
    63                -> base:GHC.Conc.STM{tc r2r} a{tv aIx} [tv]))) 
    64   (base:Control.Applicative.$fAlternativeSTM3{v r2n} [gid] 
    65    `cast` (forall a{tv aup} [sk]. 
    66            base:GHC.Conc.STM{tc r2r} a{tv aup} [sk] 
    67            -> ghc-prim:GHC.Prim.sym{(w) tc 34v} 
    68                 (base:GHC.Conc.NTCo:STM{tc r2m} [a{tv aup} [sk]]) 
    69            :: (forall a{tv aup} [sk]. 
    70                base:GHC.Conc.STM{tc r2r} a{tv aup} [sk] 
    71                -> ghc-prim:GHC.Prim.State#{(w) tc 32q} 
    72                     ghc-prim:GHC.Prim.RealWorld{(w) tc 31E} 
    73                -> (# ghc-prim:GHC.Prim.State#{(w) tc 32q} 
    74                        ghc-prim:GHC.Prim.RealWorld{(w) tc 31E}, 
    75                      [a{tv aup} [sk]] #)) 
    76                 ~ 
    77               (forall a{tv aup} [sk]. 
    78                base:GHC.Conc.STM{tc r2r} a{tv aup} [sk] 
    79                -> base:GHC.Conc.STM{tc r2r} [a{tv aup} [sk]]))) 
    80   (base:Control.Applicative.$fAlternativeSTM1{v r2l} [gid] 
    81    `cast` (forall a{tv av2} [sk]. 
    82            base:GHC.Conc.STM{tc r2r} a{tv av2} [sk] 
    83            -> ghc-prim:GHC.Prim.sym{(w) tc 34v} 
    84                 (base:GHC.Conc.NTCo:STM{tc r2m} [a{tv av2} [sk]]) 
    85            :: (forall a{tv av2} [sk]. 
    86                base:GHC.Conc.STM{tc r2r} a{tv av2} [sk] 
    87                -> ghc-prim:GHC.Prim.State#{(w) tc 32q} 
    88                     ghc-prim:GHC.Prim.RealWorld{(w) tc 31E} 
    89                -> (# ghc-prim:GHC.Prim.State#{(w) tc 32q} 
    90                        ghc-prim:GHC.Prim.RealWorld{(w) tc 31E}, 
    91                      [a{tv av2} [sk]] #)) 
    92                 ~ 
    93               (forall a{tv av2} [sk]. 
    94                base:GHC.Conc.STM{tc r2r} a{tv av2} [sk] 
    95                -> base:GHC.Conc.STM{tc r2r} [a{tv av2} [sk]]))) 
     13...blah... 
    9614base:Control.Applicative.$fAlternativeSTM{v rk} [gid[DFunId]] = 
    9715    [] \u srt:SRT:[] []