[GHC] #11232: Panic whilst compiling syb due to OptCoercion

#11232: Panic whilst compiling syb due to OptCoercion -------------------------------------+------------------------------------- Reporter: mpickering | Owner: Type: bug | Status: new Priority: high | Milestone: Component: Compiler | Version: 7.10.3 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Here is the minimised test case with most definitions inlined. {{{ module Data.Generics.Aliases where import Control.Monad import Data.Data mkMp :: ( MonadPlus m , Typeable a , Typeable b ) => (b -> m b) -> a -> m a mkMp ext = unM (maybe (M (const mzero)) id (gcast (M ext))) newtype M m x = M { unM :: x -> m x } }}} Panics with `-O2` as follows, {{{ ~/Documents/haskell/syb-0.6:ghc-7.11.20151214 Aliases.hs -O2 [1 of 1] Compiling Data.Generics.Aliases ( Aliases.hs, Aliases.o ) ghc: panic! (the 'impossible' happened) (GHC version 7.11.20151214 for x86_64-apple-darwin): ASSERT failed! file compiler/types/OptCoercion.hs, line 234 Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11232 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11232: Panic whilst compiling syb due to OptCoercion
-------------------------------------+-------------------------------------
Reporter: mpickering | Owner:
Type: bug | Status: new
Priority: high | Milestone:
Component: Compiler | Version: 7.10.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 mpickering):
In fact it fails core lint.
{{{
*** Core Lint errors : in result of Simplifier ***
<no location info>: warning:
In a case alternative: (True)
Role incompatibility: expected representational, got nominal
in UnsafeCo nominal b_a1me a_a1md
*** Offending Program ***
a_s1F4 :: TrName
[LclId,
Str=DmdType,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 30 20}]
a_s1F4 = TrNameS "main"#
a_s1F5 :: TrName
[LclId,
Str=DmdType,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 80 20}]
a_s1F5 = TrNameS "Data.Generics.Aliases"#
$trModule :: Module
[LclIdX[ReflectionId],
Str=DmdType,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
$trModule = Module a_s1F4 a_s1F5
a_s1F6 :: TrName
[LclId,
Str=DmdType,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 30 20}]
a_s1F6 = TrNameS "'M"#
$tc'M :: TyCon
[LclIdX[ReflectionId],
Str=DmdType,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 50}]
$tc'M =
TyCon 372692395467894104## 3145297546256518361## $trModule a_s1F6
a_s1F7 :: TrName
[LclId,
Str=DmdType,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 30 20}]
a_s1F7 = TrNameS "M"#
$tcM :: TyCon
[LclIdX[ReflectionId],
Str=DmdType,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 50}]
$tcM =
TyCon 12760297783238653818## 4193448421405137177## $trModule a_s1F7
a_s1F8
:: forall (m_a1kx :: * -> *) x_a1ky.
M m_a1kx x_a1ky -> M m_a1kx x_a1ky
[LclId,
Arity=1,
Str=DmdType,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=True)}]
a_s1F8 =
\ (@ (m_a1kx :: * -> *)) (@ x_a1ky) (ds_d1nw :: M m_a1kx x_a1ky) ->
ds_d1nw
unM
:: forall (m_a1gf :: * -> *) x_a1gg.
M m_a1gf x_a1gg -> x_a1gg -> m_a1gf x_a1gg
[LclIdX[[RecSel]],
Arity=1,
Str=DmdType,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}]
unM =
a_s1F8
`cast` (forall (m_a1kx :: <* -> *>_N).
forall (x_a1ky :: <*>_N).
<M m_a1kx x_a1ky>_R -> NTCo:M[0]

#11232: Panic whilst compiling syb due to OptCoercion -------------------------------------+------------------------------------- Reporter: mpickering | Owner: goldfire Type: bug | Status: new Priority: high | Milestone: Component: Compiler | Version: 7.10.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): Phab:D1645 Wiki Page: | -------------------------------------+------------------------------------- Changes (by goldfire): * owner: => goldfire * differential: => Phab:D1645 Comment: Fix in Phab:D1645. Very straightforward -- I don't know what I was thinking when I did it the wrong way. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11232#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11232: Panic whilst compiling syb due to OptCoercion
-------------------------------------+-------------------------------------
Reporter: mpickering | Owner: goldfire
Type: bug | Status: new
Priority: high | Milestone:
Component: Compiler | Version: 7.10.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): Phab:D1645
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#11232: Panic whilst compiling syb due to OptCoercion -------------------------------------+------------------------------------- Reporter: mpickering | Owner: goldfire Type: bug | Status: closed Priority: high | Milestone: Component: Compiler | Version: 7.10.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1645 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11232#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC