<div dir="ltr"><div class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br></div><br><div>I've tried to compile GHC from source using -fcatch-bottoms on the stage2.</div><div>I compiled GHC with having <b>GhcStage2HcOpts += -fcatch-bottoms</b> in <a href="http://build.mk">build.mk</a>.<br><i></i></div><div>Unfortunately it breaks programs and causes runtime error. I wanted to use this feature in an experiment.</div><div>My motivation:<br></div><div><i>I'm working on a typed external STG IR were the type system is based according GHC's PrimRep ADT. In my Ext-STG IR each case alt must have the same PrimRep result type. The vanilla Core to Stg pass breaks this invariant but the catch-bottoms option preserves it. <br></i></div><div><br></div><div>Cheers,</div><div>Csaba</div><div><br></div><div><i></i></div><div>Error output:<br></div><div><i></i></div><blockquote><span style="font-family:monospace">make</span><br><span style="font-family:monospace">===--- building phase 0</span><br><span style="font-family:monospace">make --no-print-directory -f <a href="http://ghc.mk">ghc.mk</a> phase=0 phase_0_builds</span><br><span style="font-family:monospace">make[1]: Nothing to be done for 'phase_0_builds'.</span><br><span style="font-family:monospace">===--- building phase 1</span><br><span style="font-family:monospace">make --no-print-directory -f <a href="http://ghc.mk">ghc.mk</a> phase=1 phase_1_builds</span><br><span style="font-family:monospace">make[1]: Nothing to be done for 'phase_1_builds'.</span><br><span style="font-family:monospace">===--- building final phase</span><br><span style="font-family:monospace">make --no-print-directory -f <a href="http://ghc.mk">ghc.mk</a> phase=final all</span><br><span style="font-family:monospace">"inplace/bin/ghc-stage2" -hisuf dyn_hi -osuf  dyn_o -hcsuf dyn_hc -fPIC -dynamic  -H32m -O -Wall      -hide-all-packages -i -iutils/haddock/driver -iutils/haddock/haddock-api/src -iutils/haddock/haddock-library/src -iutils/haddock/dist/build -Iutils/haddock/dist/build -iutils/haddock/dist/build/haddock/autogen -Iutils/haddock/dist/build/haddock/autogen    -optP-DIN_GHC_TREE -optP-include -optPutils/haddock/dist/build/haddock/autogen/cabal_macros.h -package-id array-0.5.4.0 -package-id base-4.13.0.0 -package-id bytestring-0.10.10.0 -package-id containers-0.6.2.1 -package-id deepseq-1.4.4.0 -package-id directory-1.3.4.0 -package-id filepath-1.4.2.1 -package-id ghc-8.8.2 -package-id ghc-boot-8.8.2 -package-id parsec-3.1.14.0 -package-id text-1.2.4.0 -package-id transformers-0.5.6.2 -package-id xhtml-3000.2.2.1 -funbox-strict-fields -Wall -fwarn-tabs -O2 -threaded -XHaskell2010  -no-user-package-db -rtsopts  -Wno-unused-imports -Wno-deprecations     -Wnoncanonical-monad-instances  -outputdir utils/haddock/dist/build    -c utils/haddock/haddock-library/src/Documentation/Haddock/Types.hs -o utils/haddock/dist/build/Documentation/Haddock/Types.dyn_o</span><br><b><span style="font-family:monospace">ghc-stage2: internal error: evacuate(static): strange closure type 0</span><br><span style="font-family:monospace">    (GHC version 8.8.2 for x86_64_unknown_linux)</span><br><span style="font-family:monospace">    Please report this as a GHC bug:  <a href="https://www.haskell.org/ghc/reportabug">https://www.haskell.org/ghc/reportabug</a></span></b><br><span style="font-family:monospace">utils/haddock/<a href="http://ghc.mk:20">ghc.mk:20</a>: recipe for target 'utils/haddock/dist/build/Documentation/Haddock/Types.dyn_o' failed</span><br><span style="font-family:monospace">make[1]: *** [utils/haddock/dist/build/Documentation/Haddock/Types.dyn_o] Aborted (core dumped)</span><br><span style="font-family:monospace">Makefile:123: recipe for target 'all' failed</span><br><span style="font-family:monospace">make: *** [all] Error 2</span></blockquote></div>