[GHC] #15066: EtaExpandLevPoly triggers a core lint error in profasm/profthreaded ways

GHC ghc-devs at haskell.org
Thu Apr 19 22:40:57 UTC 2018


#15066: EtaExpandLevPoly triggers a core lint error in profasm/profthreaded ways
----------------------------------------+---------------------------------
           Reporter:  alpmestan         |             Owner:  (none)
               Type:  bug               |            Status:  new
           Priority:  normal            |         Milestone:
          Component:  Compiler          |           Version:  8.5
           Keywords:                    |  Operating System:  Linux
       Architecture:  Unknown/Multiple  |   Type of failure:  None/Unknown
          Test Case:  EtaExpandLevPoly  |        Blocked By:
           Blocking:                    |   Related Tickets:
Differential Rev(s):                    |         Wiki Page:
----------------------------------------+---------------------------------
 Against 8b823f270e53627ddca1a993c05f1ab556742d96:

 {{{#!hs
 $ make fulltest TEST=EtaExpandLevPoly
 [...]
 =====> EtaExpandLevPoly(normal) 1 of 1 [0, 0, 0]
 cd "./typecheck/should_run/EtaExpandLevPoly.run" &&  "/home/alp/ghc-slow-
 validate/inplace/test   spaces/ghc-stage2" -o EtaExpandLevPoly
 EtaExpandLevPoly.hs -dcore-lint -dcmm-lint -no-user-package-db -rtsopts
 -fno-warn-missed-specialisations -fshow-warning-groups -fdiagnostics-
 color=never -fno-diagnostics-show-caret -dno-debug-output
 cd "./typecheck/should_run/EtaExpandLevPoly.run" && ./EtaExpandLevPoly
 =====> EtaExpandLevPoly(hpc) 1 of 1 [0, 0, 0]
 cd "./typecheck/should_run/EtaExpandLevPoly.run" &&  "/home/alp/ghc-slow-
 validate/inplace/test   spaces/ghc-stage2" -o EtaExpandLevPoly
 EtaExpandLevPoly.hs -dcore-lint -dcmm-lint -no-user-package-db -rtsopts
 -fno-warn-missed-specialisations -fshow-warning-groups -fdiagnostics-
 color=never -fno-diagnostics-show-caret -dno-debug-output  -O -fhpc
 cd "./typecheck/should_run/EtaExpandLevPoly.run" && ./EtaExpandLevPoly
 =====> EtaExpandLevPoly(optasm) 1 of 1 [0, 0, 0]
 cd "./typecheck/should_run/EtaExpandLevPoly.run" &&  "/home/alp/ghc-slow-
 validate/inplace/test   spaces/ghc-stage2" -o EtaExpandLevPoly
 EtaExpandLevPoly.hs -dcore-lint -dcmm-lint -no-user-package-db -rtsopts
 -fno-warn-missed-specialisations -fshow-warning-groups -fdiagnostics-
 color=never -fno-diagnostics-show-caret -dno-debug-output  -O -fasm
 cd "./typecheck/should_run/EtaExpandLevPoly.run" && ./EtaExpandLevPoly
 =====> EtaExpandLevPoly(profasm) 1 of 1 [0, 0, 0]
 cd "./typecheck/should_run/EtaExpandLevPoly.run" &&  "/home/alp/ghc-slow-
 validate/inplace/test   spaces/ghc-stage2" -o EtaExpandLevPoly
 EtaExpandLevPoly.hs -dcore-lint -dcmm-lint -no-user-package-db -rtsopts
 -fno-warn-missed-specialisations -fshow-warning-groups -fdiagnostics-
 color=never -fno-diagnostics-show-caret -dno-debug-output  -O -prof
 -static -fprof-auto
 Compile failed (exit code 1) errors were:
 [1 of 1] Compiling Main             ( EtaExpandLevPoly.hs,
 EtaExpandLevPoly.o )
 *** Core Lint errors : in result of Simplifier ***
 <no location info>: warning:
     In the type ‘((# Bool, Int# #) |> Sym (TYPE (Sym co_a1ww))_N)’
     co_a1ww
       :: (a_a1wt :: RuntimeRep)
          ~# ('TupleRep '['LiftedRep, 'IntRep] :: RuntimeRep)
     [LclId[CoVarId]] is out of scope
 *** Offending Program ***
 foo :: forall b. G 'LiftedRep -> b -> b
 [LclIdX,
  Arity=1,
  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)}]
 foo
   = \ (@ (a_a1wt :: RuntimeRep))
       (@ (b_a1wu :: TYPE a_a1wt))
       (ds_d1Pr :: G a_a1wt) ->
       scctick<foo>
       case ds_d1Pr of { MkG co_a1ww ->
       \ (x_a10m :: (b_a1wu |> Sym (TYPE (Sym co_a1ww))_N)) ->
         tick<foo.\> x_a10m
       }

 bar
   :: forall a.
      H 'LiftedRep -> (a -> a -> (# a, a #)) -> a -> (# a, a #)
 [LclIdX,
  Arity=1,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [20] 60 60}]
 bar
   = \ (@ (r_a1vB :: RuntimeRep))
       (@ (a_a1vC :: TYPE r_a1vB))
       (ds_d1Pk :: H r_a1vB) ->
       scctick<bar>
       case ds_d1Pk of { MkH co_a1vE ->
       (\ (f_a10o
             :: (a_a1vC |> Sym (TYPE (Sym co_a1vE))_N)
                -> (a_a1vC |> Sym (TYPE (Sym co_a1vE))_N)
                -> (# (a_a1vC |> Sym (TYPE (Sym co_a1vE))_N),
                      (a_a1vC |> Sym (TYPE (Sym co_a1vE))_N) #))
          (x_a10p :: (a_a1vC |> Sym (TYPE (Sym co_a1vE))_N)) ->
          scctick<bar.\> f_a10o x_a10p x_a10p)
       `cast` ((Coh <a_a1vC>_R (TYPE co_a1vE)_N
                ->_R Coh <a_a1vC>_R (TYPE co_a1vE)_N
                ->_R ((#,#)
                        (Sub (Sym co_a1vE))
                        (Sub (Sym co_a1vE))
                        (Coh <a_a1vC>_R (TYPE co_a1vE)_N)
                        (Coh <a_a1vC>_R (TYPE co_a1vE)_N))_R)
               ->_R Coh <a_a1vC>_R (TYPE co_a1vE)_N
               ->_R ((#,#)
                       (Sub (Sym co_a1vE))
                       (Sub (Sym co_a1vE))
                       (Coh <a_a1vC>_R (TYPE co_a1vE)_N)
                       (Coh <a_a1vC>_R (TYPE co_a1vE)_N))_R
               :: (((a_a1vC |> (TYPE co_a1vE)_N)
                    -> (a_a1vC |> (TYPE co_a1vE)_N)
                    -> (# (a_a1vC |> (TYPE co_a1vE)_N),
                          (a_a1vC |> (TYPE co_a1vE)_N) #))
                   -> (a_a1vC |> (TYPE co_a1vE)_N)
                   -> (# (a_a1vC |> (TYPE co_a1vE)_N),
                         (a_a1vC |> (TYPE co_a1vE)_N) #) :: *)
                  ~R# ((a_a1vC -> a_a1vC -> (# a_a1vC, a_a1vC #))
                       -> a_a1vC -> (# a_a1vC, a_a1vC #) :: *))
       }

 $trModule_s245 :: Addr#
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}]
 $trModule_s245 = "main"#

 $trModule_s246 :: TrName
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}]
 $trModule_s246 = TrNameS $trModule_s245

 $trModule_s247 :: Addr#
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}]
 $trModule_s247 = "Main"#

 $trModule_s248 :: TrName
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}]
 $trModule_s248 = TrNameS $trModule_s247

 $trModule :: Module
 [LclIdX,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $trModule = Module $trModule_s246 $trModule_s248

 $krep_a1P3 [InlPrag=NOUSERINLINE[~]] :: KindRep
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_a1P3 = KindRepTyConApp $tc'LiftedRep ([] @ KindRep)

 $krep_a1OZ [InlPrag=NOUSERINLINE[~]] :: KindRep
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_a1OZ = KindRepTyConApp $tc'IntRep ([] @ KindRep)

 $krep_a1OX [InlPrag=NOUSERINLINE[~]] :: KindRep
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_a1OX = KindRepTyConApp $tcRuntimeRep ([] @ KindRep)

 $krep_a1OW [InlPrag=NOUSERINLINE[~]] :: KindRep
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_a1OW = KindRepFun $krep_a1OX krep$*

 $krep_s249 :: [KindRep]
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_s249 = : @ KindRep $krep_a1OX ([] @ KindRep)

 $krep_a1P5 [InlPrag=NOUSERINLINE[~]] :: KindRep
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_a1P5 = KindRepTyConApp $tc'[] $krep_s249

 $krep_s24a :: [KindRep]
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_s24a = : @ KindRep $krep_a1P5 ([] @ KindRep)

 $krep_s24b :: [KindRep]
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_s24b = : @ KindRep $krep_a1OZ $krep_s24a

 $krep_s24c :: [KindRep]
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_s24c = : @ KindRep $krep_a1OX $krep_s24b

 $krep_a1P4 [InlPrag=NOUSERINLINE[~]] :: KindRep
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_a1P4 = KindRepTyConApp $tc': $krep_s24c

 $krep_s24d :: [KindRep]
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_s24d = : @ KindRep $krep_a1P4 ([] @ KindRep)

 $krep_s24e :: [KindRep]
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_s24e = : @ KindRep $krep_a1P3 $krep_s24d

 $krep_s24f :: [KindRep]
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_s24f = : @ KindRep $krep_a1OX $krep_s24e

 $krep_a1P2 [InlPrag=NOUSERINLINE[~]] :: KindRep
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_a1P2 = KindRepTyConApp $tc': $krep_s24f

 $krep_s24g :: [KindRep]
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_s24g = : @ KindRep $krep_a1P2 ([] @ KindRep)

 $krep_a1P1 [InlPrag=NOUSERINLINE[~]] :: KindRep
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_a1P1 = KindRepTyConApp $tc'TupleRep $krep_s24g

 $tcG_s24h :: Addr#
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}]
 $tcG_s24h = "G"#

 $tcG_s24i :: TrName
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}]
 $tcG_s24i = TrNameS $tcG_s24h

 $tcG :: TyCon
 [LclIdX,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 70}]
 $tcG
   = TyCon
       14221008574166376522##
       17210926818700297107##
       $trModule
       $tcG_s24i
       0#
       $krep_a1OW

 $krep_s24j :: [KindRep]
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_s24j = : @ KindRep $krep_a1P1 ([] @ KindRep)

 $krep_a1P0 [InlPrag=NOUSERINLINE[~]] :: KindRep
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_a1P0 = KindRepTyConApp $tcG $krep_s24j

 $tc'MkG_s24k :: Addr#
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}]
 $tc'MkG_s24k = "'MkG"#

 $tc'MkG_s24l :: TrName
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}]
 $tc'MkG_s24l = TrNameS $tc'MkG_s24k

 $tc'MkG :: TyCon
 [LclIdX,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 70}]
 $tc'MkG
   = TyCon
       11219666876303220503##
       4566534404187760096##
       $trModule
       $tc'MkG_s24l
       0#
       $krep_a1P0

 $tcH_s24m :: Addr#
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}]
 $tcH_s24m = "H"#

 $tcH_s24n :: TrName
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}]
 $tcH_s24n = TrNameS $tcH_s24m

 $tcH :: TyCon
 [LclIdX,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 70}]
 $tcH
   = TyCon
       5827673930009354874##
       4277163490596771739##
       $trModule
       $tcH_s24n
       0#
       $krep_a1OW

 $krep_s24o :: [KindRep]
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_s24o = : @ KindRep $krep_a1OZ ([] @ KindRep)

 $krep_a1OY [InlPrag=NOUSERINLINE[~]] :: KindRep
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_a1OY = KindRepTyConApp $tcH $krep_s24o

 $tc'MkH_s24p :: Addr#
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}]
 $tc'MkH_s24p = "'MkH"#

 $tc'MkH_s24q :: TrName
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}]
 $tc'MkH_s24q = TrNameS $tc'MkH_s24p

 $tc'MkH :: TyCon
 [LclIdX,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 70}]
 $tc'MkH
   = TyCon
       273175143458456096##
       17487285292499736820##
       $trModule
       $tc'MkH_s24q
       0#
       $krep_a1OY

 main :: IO ()
 [LclIdX,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
          WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 510 0}]
 main
   = scctick<main>
     case (tick<foo>
           \ (x_a10m :: ((# Bool, Int# #) |> Sym (TYPE (Sym co_a1ww))_N))
 ->
             scc<foo> tick<foo.\> x_a10m)
            (# True, 3# #)
     of ds_d23V
     { (# ipv_s24s, ipv_s24t #) ->
     (\ (s_a24P :: State# RealWorld) ->
        case ((hPutStr' stdout ($fShowBool_$cshow ipv_s24s) True)
              `cast` (N:IO[0] <()>_R
                      :: (IO () :: *)
                         ~R# (State# RealWorld -> (# State# RealWorld, ()
 #) :: *)))
               s_a24P
        of
        { (# ipv_a24S, ipv1_a24T #) ->
        case ((hPutStr'
                 stdout (showSignedInt $fShow(,)1 (I# ipv_s24t) ([] @
 Char)) True)
              `cast` (N:IO[0] <()>_R
                      :: (IO () :: *)
                         ~R# (State# RealWorld -> (# State# RealWorld, ()
 #) :: *)))
               ipv_a24S
        of
        { (# ipv_X265, ipv1_X267 #) ->
        ((case (scctick<bar>
                case $WMkH of { MkH co_a1vE ->
                \ (f_a10o :: Int# -> Int# -> (# Int#, Int# #)) (x_a10p ::
 Int#) ->
                  scctick<bar.\> f_a10o x_a10p x_a10p
                })
                 ((#,#) @ 'IntRep @ 'IntRep @ Int# @ Int#) 8#
          of ds_d23T
          { (# ipv_s25y, ipv_s25z #) ->
          (\ (s_X26d :: State# RealWorld) ->
             case ((hPutStr'
                      stdout (showSignedInt $fShow(,)1 (I# ipv_s25y) ([] @
 Char)) True)
                   `cast` (N:IO[0] <()>_R
                           :: (IO () :: *)
                              ~R# (State# RealWorld -> (# State# RealWorld,
 () #) :: *)))
                    s_X26d
             of
             { (# ipv_X26j, ipv1_X26l #) ->
             ((hPutStr'
                 stdout (showSignedInt $fShow(,)1 (I# ipv_s25z) ([] @
 Char)) True)
              `cast` (N:IO[0] <()>_R
                      :: (IO () :: *)
                         ~R# (State# RealWorld -> (# State# RealWorld, ()
 #) :: *)))
               ipv_X26j
             })
          `cast` (Sym (N:IO[0] <()>_R)
                  :: (State# RealWorld -> (# State# RealWorld, () #) :: *)
                     ~R# (IO () :: *))
          })
         `cast` (N:IO[0] <()>_R
                 :: (IO () :: *)
                    ~R# (State# RealWorld -> (# State# RealWorld, () #) ::
 *)))
          ipv_X265
        }
        })
     `cast` (Sym (N:IO[0] <()>_R)
             :: (State# RealWorld -> (# State# RealWorld, () #) :: *)
                ~R# (IO () :: *))
     }

 main_s3to :: State# RealWorld -> (# State# RealWorld, () #)
 [LclId,
  Arity=1,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 60}]
 main_s3to = runMainIO1 @ () main

 main :: IO ()
 [LclIdX,
  Arity=1,
  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)}]
 main
   = main_s3to
     `cast` (Sym (N:IO[0] <()>_R)
             :: (State# RealWorld -> (# State# RealWorld, () #) :: *)
                ~R# (IO () :: *))

 *** End of Offense ***


 <no location info>: error:
 Compilation had errors



 *** unexpected failure for EtaExpandLevPoly(profasm)
 =====> EtaExpandLevPoly(threaded1) 1 of 1 [0, 1, 0]
 cd "./typecheck/should_run/EtaExpandLevPoly.run" &&  "/home/alp/ghc-slow-
 validate/inplace/test   spaces/ghc-stage2" -o EtaExpandLevPoly
 EtaExpandLevPoly.hs -dcore-lint -dcmm-lint -no-user-package-db -rtsopts
 -fno-warn-missed-specialisations -fshow-warning-groups -fdiagnostics-
 color=never -fno-diagnostics-show-caret -dno-debug-output  -threaded
 -debug
 cd "./typecheck/should_run/EtaExpandLevPoly.run" && ./EtaExpandLevPoly
 =====> EtaExpandLevPoly(threaded2) 1 of 1 [0, 1, 0]
 cd "./typecheck/should_run/EtaExpandLevPoly.run" &&  "/home/alp/ghc-slow-
 validate/inplace/test   spaces/ghc-stage2" -o EtaExpandLevPoly
 EtaExpandLevPoly.hs -dcore-lint -dcmm-lint -no-user-package-db -rtsopts
 -fno-warn-missed-specialisations -fshow-warning-groups -fdiagnostics-
 color=never -fno-diagnostics-show-caret -dno-debug-output  -O -threaded
 -eventlog
 cd "./typecheck/should_run/EtaExpandLevPoly.run" && ./EtaExpandLevPoly
 +RTS -N2 -ls -RTS
 =====> EtaExpandLevPoly(dyn) 1 of 1 [0, 1, 0]
 cd "./typecheck/should_run/EtaExpandLevPoly.run" &&  "/home/alp/ghc-slow-
 validate/inplace/test   spaces/ghc-stage2" -o EtaExpandLevPoly
 EtaExpandLevPoly.hs -dcore-lint -dcmm-lint -no-user-package-db -rtsopts
 -fno-warn-missed-specialisations -fshow-warning-groups -fdiagnostics-
 color=never -fno-diagnostics-show-caret -dno-debug-output  -O -dynamic
 cd "./typecheck/should_run/EtaExpandLevPoly.run" && ./EtaExpandLevPoly
 =====> EtaExpandLevPoly(profthreaded) 1 of 1 [0, 1, 0]
 cd "./typecheck/should_run/EtaExpandLevPoly.run" &&  "/home/alp/ghc-slow-
 validate/inplace/test   spaces/ghc-stage2" -o EtaExpandLevPoly
 EtaExpandLevPoly.hs -dcore-lint -dcmm-lint -no-user-package-db -rtsopts
 -fno-warn-missed-specialisations -fshow-warning-groups -fdiagnostics-
 color=never -fno-diagnostics-show-caret -dno-debug-output  -O -prof
 -static -fprof-auto -threaded
 Compile failed (exit code 1) errors were:
 [1 of 1] Compiling Main             ( EtaExpandLevPoly.hs,
 EtaExpandLevPoly.o )
 *** Core Lint errors : in result of Simplifier ***
 <no location info>: warning:
     In the type ‘((# Bool, Int# #) |> Sym (TYPE (Sym co_a1ww))_N)’
     co_a1ww
       :: (a_a1wt :: RuntimeRep)
          ~# ('TupleRep '['LiftedRep, 'IntRep] :: RuntimeRep)
     [LclId[CoVarId]] is out of scope
 *** Offending Program ***
 foo :: forall b. G 'LiftedRep -> b -> b
 [LclIdX,
  Arity=1,
  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)}]
 foo
   = \ (@ (a_a1wt :: RuntimeRep))
       (@ (b_a1wu :: TYPE a_a1wt))
       (ds_d1Pr :: G a_a1wt) ->
       scctick<foo>
       case ds_d1Pr of { MkG co_a1ww ->
       \ (x_a10m :: (b_a1wu |> Sym (TYPE (Sym co_a1ww))_N)) ->
         tick<foo.\> x_a10m
       }

 bar
   :: forall a.
      H 'LiftedRep -> (a -> a -> (# a, a #)) -> a -> (# a, a #)
 [LclIdX,
  Arity=1,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [20] 60 60}]
 bar
   = \ (@ (r_a1vB :: RuntimeRep))
       (@ (a_a1vC :: TYPE r_a1vB))
       (ds_d1Pk :: H r_a1vB) ->
       scctick<bar>
       case ds_d1Pk of { MkH co_a1vE ->
       (\ (f_a10o
             :: (a_a1vC |> Sym (TYPE (Sym co_a1vE))_N)
                -> (a_a1vC |> Sym (TYPE (Sym co_a1vE))_N)
                -> (# (a_a1vC |> Sym (TYPE (Sym co_a1vE))_N),
                      (a_a1vC |> Sym (TYPE (Sym co_a1vE))_N) #))
          (x_a10p :: (a_a1vC |> Sym (TYPE (Sym co_a1vE))_N)) ->
          scctick<bar.\> f_a10o x_a10p x_a10p)
       `cast` ((Coh <a_a1vC>_R (TYPE co_a1vE)_N
                ->_R Coh <a_a1vC>_R (TYPE co_a1vE)_N
                ->_R ((#,#)
                        (Sub (Sym co_a1vE))
                        (Sub (Sym co_a1vE))
                        (Coh <a_a1vC>_R (TYPE co_a1vE)_N)
                        (Coh <a_a1vC>_R (TYPE co_a1vE)_N))_R)
               ->_R Coh <a_a1vC>_R (TYPE co_a1vE)_N
               ->_R ((#,#)
                       (Sub (Sym co_a1vE))
                       (Sub (Sym co_a1vE))
                       (Coh <a_a1vC>_R (TYPE co_a1vE)_N)
                       (Coh <a_a1vC>_R (TYPE co_a1vE)_N))_R
               :: (((a_a1vC |> (TYPE co_a1vE)_N)
                    -> (a_a1vC |> (TYPE co_a1vE)_N)
                    -> (# (a_a1vC |> (TYPE co_a1vE)_N),
                          (a_a1vC |> (TYPE co_a1vE)_N) #))
                   -> (a_a1vC |> (TYPE co_a1vE)_N)
                   -> (# (a_a1vC |> (TYPE co_a1vE)_N),
                         (a_a1vC |> (TYPE co_a1vE)_N) #) :: *)
                  ~R# ((a_a1vC -> a_a1vC -> (# a_a1vC, a_a1vC #))
                       -> a_a1vC -> (# a_a1vC, a_a1vC #) :: *))
       }

 $trModule_s245 :: Addr#
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}]
 $trModule_s245 = "main"#

 $trModule_s246 :: TrName
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}]
 $trModule_s246 = TrNameS $trModule_s245

 $trModule_s247 :: Addr#
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}]
 $trModule_s247 = "Main"#

 $trModule_s248 :: TrName
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}]
 $trModule_s248 = TrNameS $trModule_s247

 $trModule :: Module
 [LclIdX,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $trModule = Module $trModule_s246 $trModule_s248

 $krep_a1P3 [InlPrag=NOUSERINLINE[~]] :: KindRep
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_a1P3 = KindRepTyConApp $tc'LiftedRep ([] @ KindRep)

 $krep_a1OZ [InlPrag=NOUSERINLINE[~]] :: KindRep
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_a1OZ = KindRepTyConApp $tc'IntRep ([] @ KindRep)

 $krep_a1OX [InlPrag=NOUSERINLINE[~]] :: KindRep
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_a1OX = KindRepTyConApp $tcRuntimeRep ([] @ KindRep)

 $krep_a1OW [InlPrag=NOUSERINLINE[~]] :: KindRep
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_a1OW = KindRepFun $krep_a1OX krep$*

 $krep_s249 :: [KindRep]
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_s249 = : @ KindRep $krep_a1OX ([] @ KindRep)

 $krep_a1P5 [InlPrag=NOUSERINLINE[~]] :: KindRep
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_a1P5 = KindRepTyConApp $tc'[] $krep_s249

 $krep_s24a :: [KindRep]
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_s24a = : @ KindRep $krep_a1P5 ([] @ KindRep)

 $krep_s24b :: [KindRep]
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_s24b = : @ KindRep $krep_a1OZ $krep_s24a

 $krep_s24c :: [KindRep]
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_s24c = : @ KindRep $krep_a1OX $krep_s24b

 $krep_a1P4 [InlPrag=NOUSERINLINE[~]] :: KindRep
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_a1P4 = KindRepTyConApp $tc': $krep_s24c

 $krep_s24d :: [KindRep]
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_s24d = : @ KindRep $krep_a1P4 ([] @ KindRep)

 $krep_s24e :: [KindRep]
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_s24e = : @ KindRep $krep_a1P3 $krep_s24d

 $krep_s24f :: [KindRep]
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_s24f = : @ KindRep $krep_a1OX $krep_s24e

 $krep_a1P2 [InlPrag=NOUSERINLINE[~]] :: KindRep
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_a1P2 = KindRepTyConApp $tc': $krep_s24f

 $krep_s24g :: [KindRep]
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_s24g = : @ KindRep $krep_a1P2 ([] @ KindRep)

 $krep_a1P1 [InlPrag=NOUSERINLINE[~]] :: KindRep
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_a1P1 = KindRepTyConApp $tc'TupleRep $krep_s24g

 $tcG_s24h :: Addr#
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}]
 $tcG_s24h = "G"#

 $tcG_s24i :: TrName
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}]
 $tcG_s24i = TrNameS $tcG_s24h

 $tcG :: TyCon
 [LclIdX,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 70}]
 $tcG
   = TyCon
       14221008574166376522##
       17210926818700297107##
       $trModule
       $tcG_s24i
       0#
       $krep_a1OW

 $krep_s24j :: [KindRep]
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_s24j = : @ KindRep $krep_a1P1 ([] @ KindRep)

 $krep_a1P0 [InlPrag=NOUSERINLINE[~]] :: KindRep
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_a1P0 = KindRepTyConApp $tcG $krep_s24j

 $tc'MkG_s24k :: Addr#
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}]
 $tc'MkG_s24k = "'MkG"#

 $tc'MkG_s24l :: TrName
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}]
 $tc'MkG_s24l = TrNameS $tc'MkG_s24k

 $tc'MkG :: TyCon
 [LclIdX,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 70}]
 $tc'MkG
   = TyCon
       11219666876303220503##
       4566534404187760096##
       $trModule
       $tc'MkG_s24l
       0#
       $krep_a1P0

 $tcH_s24m :: Addr#
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}]
 $tcH_s24m = "H"#

 $tcH_s24n :: TrName
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}]
 $tcH_s24n = TrNameS $tcH_s24m

 $tcH :: TyCon
 [LclIdX,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 70}]
 $tcH
   = TyCon
       5827673930009354874##
       4277163490596771739##
       $trModule
       $tcH_s24n
       0#
       $krep_a1OW

 $krep_s24o :: [KindRep]
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_s24o = : @ KindRep $krep_a1OZ ([] @ KindRep)

 $krep_a1OY [InlPrag=NOUSERINLINE[~]] :: KindRep
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
 $krep_a1OY = KindRepTyConApp $tcH $krep_s24o

 $tc'MkH_s24p :: Addr#
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}]
 $tc'MkH_s24p = "'MkH"#

 $tc'MkH_s24q :: TrName
 [LclId,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}]
 $tc'MkH_s24q = TrNameS $tc'MkH_s24p

 $tc'MkH :: TyCon
 [LclIdX,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 70}]
 $tc'MkH
   = TyCon
       273175143458456096##
       17487285292499736820##
       $trModule
       $tc'MkH_s24q
       0#
       $krep_a1OY

 main :: IO ()
 [LclIdX,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
          WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 510 0}]
 main
   = scctick<main>
     case (tick<foo>
           \ (x_a10m :: ((# Bool, Int# #) |> Sym (TYPE (Sym co_a1ww))_N))
 ->
             scc<foo> tick<foo.\> x_a10m)
            (# True, 3# #)
     of ds_d23V
     { (# ipv_s24s, ipv_s24t #) ->
     (\ (s_a24P :: State# RealWorld) ->
        case ((hPutStr' stdout ($fShowBool_$cshow ipv_s24s) True)
              `cast` (N:IO[0] <()>_R
                      :: (IO () :: *)
                         ~R# (State# RealWorld -> (# State# RealWorld, ()
 #) :: *)))
               s_a24P
        of
        { (# ipv_a24S, ipv1_a24T #) ->
        case ((hPutStr'
                 stdout (showSignedInt $fShow(,)1 (I# ipv_s24t) ([] @
 Char)) True)
              `cast` (N:IO[0] <()>_R
                      :: (IO () :: *)
                         ~R# (State# RealWorld -> (# State# RealWorld, ()
 #) :: *)))
               ipv_a24S
        of
        { (# ipv_X265, ipv1_X267 #) ->
        ((case (scctick<bar>
                case $WMkH of { MkH co_a1vE ->
                \ (f_a10o :: Int# -> Int# -> (# Int#, Int# #)) (x_a10p ::
 Int#) ->
                  scctick<bar.\> f_a10o x_a10p x_a10p
                })
                 ((#,#) @ 'IntRep @ 'IntRep @ Int# @ Int#) 8#
          of ds_d23T
          { (# ipv_s25y, ipv_s25z #) ->
          (\ (s_X26d :: State# RealWorld) ->
             case ((hPutStr'
                      stdout (showSignedInt $fShow(,)1 (I# ipv_s25y) ([] @
 Char)) True)
                   `cast` (N:IO[0] <()>_R
                           :: (IO () :: *)
                              ~R# (State# RealWorld -> (# State# RealWorld,
 () #) :: *)))
                    s_X26d
             of
             { (# ipv_X26j, ipv1_X26l #) ->
             ((hPutStr'
                 stdout (showSignedInt $fShow(,)1 (I# ipv_s25z) ([] @
 Char)) True)
              `cast` (N:IO[0] <()>_R
                      :: (IO () :: *)
                         ~R# (State# RealWorld -> (# State# RealWorld, ()
 #) :: *)))
               ipv_X26j
             })
          `cast` (Sym (N:IO[0] <()>_R)
                  :: (State# RealWorld -> (# State# RealWorld, () #) :: *)
                     ~R# (IO () :: *))
          })
         `cast` (N:IO[0] <()>_R
                 :: (IO () :: *)
                    ~R# (State# RealWorld -> (# State# RealWorld, () #) ::
 *)))
          ipv_X265
        }
        })
     `cast` (Sym (N:IO[0] <()>_R)
             :: (State# RealWorld -> (# State# RealWorld, () #) :: *)
                ~R# (IO () :: *))
     }

 main_s3to :: State# RealWorld -> (# State# RealWorld, () #)
 [LclId,
  Arity=1,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
          WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 60}]
 main_s3to = runMainIO1 @ () main

 main :: IO ()
 [LclIdX,
  Arity=1,
  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)}]
 main
   = main_s3to
     `cast` (Sym (N:IO[0] <()>_R)
             :: (State# RealWorld -> (# State# RealWorld, () #) :: *)
                ~R# (IO () :: *))

 *** End of Offense ***


 <no location info>: error:
 Compilation had errors



 *** unexpected failure for EtaExpandLevPoly(profthreaded)

 Unexpected results from:
 TEST="EtaExpandLevPoly"

 SUMMARY for test run started at Fri Apr 20 00:34:52 2018 CEST
  0:00:05 spent to go through
        1 total tests, which gave rise to
        9 test cases, of which
        1 were skipped

        0 had missing libraries
        6 expected passes
        0 expected failures

        0 caused framework failures
        0 caused framework warnings
        0 unexpected passes
        2 unexpected failures
        0 unexpected stat failures

 Unexpected failures:
    typecheck/should_run/EtaExpandLevPoly.run  EtaExpandLevPoly [exit code
 non-0] (profasm)
    typecheck/should_run/EtaExpandLevPoly.run  EtaExpandLevPoly [exit code
 non-0] (profthreaded)
 }}}

 I'll mark the test as expected broken in those ways for now, linking to
 this ticket.

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


More information about the ghc-tickets mailing list