[GHC] #11172: Turning on optimisations produces SEGFAULT or Impossible case alternative

GHC ghc-devs at haskell.org
Tue Jan 19 15:06:33 UTC 2016


#11172: Turning on optimisations produces SEGFAULT or Impossible case alternative
-------------------------------------+-------------------------------------
        Reporter:  nh2               |                Owner:  bgamari
            Type:  bug               |               Status:  new
        Priority:  highest           |            Milestone:  8.0.1
       Component:  Compiler          |              Version:  7.10.2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  Runtime crash     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by bgamari):

 It appears that this,
 {{{#!hs
               (\ (a48_aeBK :: (Either () Int, Module.JSONState Double)) ->
                  case a48_aeBK of _ [Occ=Dead] { (a1_aeN0, s'_aeN1) ->
                  case a1_aeN0 of _ [Occ=Dead] {
                    Left l_aeDR ->
                      ks_XeD2 (Data.Either.Left @ () @ Int l_aeDR,
 s'_aeN1);
                    Right r_aeDU ->
                      ks_XeD2 (Data.Either.Right @ () @ Int r_aeDU,
 s'_aeN1)
                  }
                  })
 }}}
 is getting simplified to,
 {{{#!hs
               (\ (a48_aeBK :: (Either () Int, Module.JSONState Double)) ->
                  case a48_aeBK
                  of _ [Occ=Dead, Dmd=<L,A>]
                  { (a1_aeN0 [Dmd=<S,1*U>], s'_aeN1 [Dmd=<S,1*U(A,U,A)>])
 ->
                  case a1_aeN0 of _ [Occ=Dead, Dmd=<L,A>] {
                    Left l_aeDR ->
                      case s'_aeN1
                      of _ [Occ=Dead] { Module.JSONState ww_shDN ww_shDO
 ww_shDP ->
                      Control.Exception.Base.runtimeError
                        @ (Either String (Either () Int, Module.JSONState
 ()))
                        "Impossible case alternative"#
                      };
                    Right r_aeDU ->
                      case s'_aeN1
                      of _ [Occ=Dead] { Module.JSONState ww_shDN ww_shDO
 ww_shDP ->
                      Data.Either.Right
                        @ String
                        @ (Either () Int, Module.JSONState ())
                        (a1_aeMD,
                         Module.JSONState @ () (GHC.Types.[] @ String)
 ww_shDO GHC.Tuple.())
                      }
                  }
                  })
 }}}

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


More information about the ghc-tickets mailing list