[GHC] #14536: Ghc panics while building stage2 with -dstg-lint

GHC ghc-devs at haskell.org
Tue Nov 28 17:34:51 UTC 2017


#14536: Ghc panics while building stage2 with -dstg-lint
-------------------------------------+-------------------------------------
        Reporter:  duog              |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 Humph.  The 'unarise' pass, which is performed on STG, also transforms
 types. In this case we transform
 {{{
 case getMaskingState# eta of x { (# a, b #) -> blah
 ===>
 case getMaskingState# eta of x { Unit# a -> blah
   -- Unit# is really a one-tuple (# a #)
 }}}
 Here we eliminate the void field (the state token).

 But that changes the type of the scrutinee; but we don't in fact change
 the type of the case-binder `x`; and that in turn leads to the crash.

 It's not very convenient to get hold of `x`'s new type; and in any case
 `x` is guaranteed to be dead.  So it seems hardly worth writing more code.

 Lets either
 * Simply drop the lint check (in `litAlt`, don't call
 `dataConInstArgTys`); or
 * Make the case-binder into a `Maybe` and only check its type when it's a
 `Just`.

 I suspect that the former is simpler for now; do leave a comment to link
 to this ticket though.

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


More information about the ghc-tickets mailing list