Compiling stage2 GHC crashes with -O2 and -DDEBUG
I'm compiling the stage2 compiler with -O2
and -DDEBUG
and I get a crash
| Run Ghc CompileHs Stage1: libraries/ghci/GHCi/TH.hs => _build/stage1/libraries/ghci/build/GHCi/TH.o
Command line: _build/stage0/bin/ghc -Wall -Wcompat -dynamic-too -hisuf hi -osuf o -hcsuf hc -static -hide-all-packages -no-user-package-db '-package-env -' '-package-db _build/stage1/lib/package.conf.d' '-this-unit-id ghci-9.5' '-package-id array-0.5.4.0' '-package-id base-4.16.0.0' '-package-id binary-0.8.9.0' '-package-id bytestring-0.11.3.0' '-package-id containers-0.6.5.1' '-package-id deepseq-1.4.7.0' '-package-id filepath-1.4.2.1' '-package-id ghc-boot-9.5' '-package-id ghc-heap-9.5' '-package-id ghc-prim-0.8.0' '-package-id rts-1.0.2' '-package-id template-haskell-2.18.0.0' '-package-id transformers-0.5.6.2' '-package-id unix-2.7.2.2' -i -i/home/simonpj/code/HEAD-4/_build/stage1/libraries/ghci/build -i/home/simonpj/code/HEAD-4/_build/stage1/libraries/ghci/build/autogen -i/home/simonpj/code/HEAD-4/libraries/ghci -Irts/include -I_build/stage1/libraries/ghci/build -I/home/simonpj/code/HEAD-4/_build/stage1/lib/x86_64-linux-ghc-9.5.20220620/unix-2.7.2.2/include -I/home/simonpj/code/HEAD-4/_build/stage1/lib/x86_64-linux-ghc-9.5.20220620/time-1.12.2/include -I/home/simonpj/code/HEAD-4/_build/stage1/lib/x86_64-linux-ghc-9.5.20220620/bytestring-0.11.3.0/include -I/home/simonpj/code/HEAD-4/_build/stage1/lib/x86_64-linux-ghc-9.5.20220620/base-4.16.0.0/include -I/home/simonpj/code/HEAD-4/_build/stage1/lib/x86_64-linux-ghc-9.5.20220620/ghc-bignum-1.3/include -I/home/simonpj/code/HEAD-4/_build/stage1/lib/x86_64-linux-ghc-9.5.20220620/rts-1.0.2/include -optP-include -optP_build/stage1/libraries/ghci/build/autogen/cabal_macros.h -optP-DHAVE_INTERNAL_INTERPRETER -outputdir _build/stage1/libraries/ghci/build -fdiagnostics-color=always -Wnoncanonical-monad-instances -optc-Wno-error=inline -optP-Wno-nonportable-include-path -c libraries/ghci/GHCi/TH.hs -o _build/stage1/libraries/ghci/build/GHCi/TH.o -O2 -H32m -XHaskell2010 -XNoImplicitPrelude -no-global-package-db -package-db=/home/simonpj/code/HEAD-4/_build/stage1/lib/package.conf.d -ghcversion-file=rts/include/ghcversion.h -ghcversion-file=rts/include/ghcversion.h -haddock -Wno-deprecated-flags -dcore-lint -DDEBUG -ticky
===> Command failed with error code: 1
panic! (the 'impossible' happened)
GHC version 9.5.20220620:
ASSERT failed!
CallStack (from HasCallStack):
assert, called at compiler/GHC/Core/Opt/SpecConstr.hs:2591:5 in ghc:GHC.Core.Opt.SpecConstr
My build settings are these
userFlavour = defaultFlavour
{ name = "user"
-- No profiled libraries
, libraryWays = Set.fromList <$>
mconcat
[ pure [vanilla]
, notStage0 ? pure [profiling]
, notStage0 ? platformSupportsSharedLibs ? pure [dynamic] ]
-- Assertions on, always
, ghcDebugAssertions = True
-- Everything built with the stage-1 compiler has -ticky, and -dcore-lint
-- Notably, the libraries
, args = defaultArgs
<> (builder Ghc ? (arg "-dcore-lint" <> arg "-DDEBUG"))
<> (builder Ghc ? stage1 ? arg "-ticky")
}
This is un-modified HEAD.