[GHC] #14880: GHC panic: updateRole

GHC ghc-devs at haskell.org
Thu Jul 26 11:07:49 UTC 2018


#14880: GHC panic: updateRole
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  goldfire
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.2.2
  checker)                           |
      Resolution:                    |             Keywords:  TypeInType
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash or panic                     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #15076            |  Differential Rev(s):  Phab:D4769
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by tdammers):

 Replying to [comment:60 simonpj]:
 > > Can you remember whether that situation involved raw VarSets, or FVs?
 >
 > The old code for `tyCoFVsOfType` looked like
 > {{{
 > fvs_of_type (AppTy fun arg)    a b c = (fvs_of_type fun `unionFV`
 fvs_of_type arg) a b c
 > }}}
 > I believe that if you eta reduce this to
 > {{{
 > fvs_of_type (AppTy fun arg) = (fvs_of_type fun `unionFV` fvs_of_type
 arg)
 > }}}
 > it runs a lot slower.  That should not happen, but I recall that it did.
 I don't understand what you mean about "avoiding hitting the underlying
 `IntSet` entirely".

 Well, if you look at the definition of `FV`:

 {{{#!haskell
 type FV = InterestingVarFun
              -- Used for filtering sets as we build them
           -> VarSet
              -- Locally bound variables
           -> ([Var], VarSet)
              -- List to preserve ordering and set to check for membership,
              -- so that the list doesn't have duplicates
              -- For explanation of why using `VarSet` is not deterministic
 see
              -- Note [Deterministic UniqFM] in UniqDFM.
           -> ([Var], VarSet)
 }}}

 ...then it's not immediately obvious that code that manipulates `FV`s will
 always touch the `VarSet`s in there at all. Specifically, variables that
 are not "interesting" bypass the `VarSet` (i.e., `IntSet`) machinery
 entirely, if I'm not mistaken.

 Not sure if that has anything to do with the problem at hand though.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14880#comment:61>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list