typePrimRep invariants

Csaba Hruska csaba.hruska at gmail.com
Fri Nov 30 21:47:46 UTC 2018


I'd like to export the PrimRep of every binder and data con from Haskell

I have a modified GHC 8.6 which serializes the PrimRep for every binder
during the compilation. It uses the *typePrimRep* function. When my
customised GHC compiles the base library it always thows the following
error for the *libraries/base/GHC/Err.hs*

   1. Does that mean that there is hidden requirement for typePrimRep input?
   2. If so what are the restrictions?
   3. Can you see anything in the Err module source code that could not be
   a proper input for typePrimRep function?


"inplace/bin/ghc-stage1" -hisuf hi -osuf  o -hcsuf hc -static  -H32m -O
-Wall      -this-unit-id base- -hide-all-packages -i
-ilibraries/base/. -ilibraries/base/dist-install/build
-Ilibraries/base/dist-install/build/./autogen -Ilibraries/base/include
-optPlibraries/base/dist-install/build/./autogen/cabal_macros.h -package-id
ghc-prim-0.5.3 -package-id integer-gmp- -package-id rts
-this-unit-id base -Wcompat -Wnoncanonical-monad-instances -XHaskell2010
-O2 -haddock  -no-user-package-db -rtsopts  -Wno-trustworthy-safe
-Wno-deprecated-flags     -Wnoncanonical-monad-instances  -odir
libraries/base/dist-install/build -hidir libraries/base/dist-install/build
-stubdir libraries/base/dist-install/build  -split-sections -dynamic-too -c
libraries/base/./GHC/Err.hs -o libraries/base/dist-install/build/GHC/Err.o
-dyno libraries/base/dist-install/build/GHC/Err.dyn_o
ghc-stage1: panic! (the 'impossible' happened)
  (GHC version 8.6.2 for x86_64-unknown-linux):
  typePrimRep (a_a1ML :: TYPE r_a1MK)
  Call stack:
      CallStack (from HasCallStack):
        callStackDoc, called at compiler/utils/Outputable.hs:1160:37 in
        pprPanic, called at compiler/simplStg/RepType.hs:358:5 in

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

libraries/base/ghc.mk:4: recipe for target
'libraries/base/dist-install/build/GHC/Err.o' failed
make[1]: *** [libraries/base/dist-install/build/GHC/Err.o] Error 1
Makefile:122: recipe for target 'all' failed
make: *** [all] Error 2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20181130/ebab3b63/attachment.html>

More information about the ghc-devs mailing list