Panic in unarise when compiling GHC with -fprof-auto-calls
When I build with --flavour=perf+profiled_ghc using -fprof-auto-calls (instead of the default -fprof-late) I get a panic:
| Run Ghc CompileHs Stage1: compiler/GHC/CmmToAsm/Reg/Linear.hs => _build/stage1/compiler/build/GHC/CmmToAsm/Reg/Linear.p_o
Command line: _build/stage0/bin/ghc -Wall -Wcompat -hisuf p_hi -osuf p_o -hcsuf p_hc -static -prof -hide-all-packages -no-user-package-db '-package-env -' '-package-db _build/stage1/inplace/package.conf.d' '-this-unit-id ghc-9.15-inplace' '-this-package-name ghc' '-package-id array-0.5.8.0-inplace' '-package-id base-4.22.0.0-inplace' '-package-id binary-0.8.9.3-inplace' '-package-id bytestring-0.12.2.0-inplace' '-package-id containers-0.8-inplace' '-package-id deepseq-1.5.1.0-inplace' '-package-id directory-1.3.10.0-inplace' '-package-id exceptions-0.10.9-inplace' '-package-id filepath-1.5.4.0-inplace' '-package-id ghc-boot-9.15-inplace' '-package-id ghc-boot-th-9.15-inplace' '-package-id ghc-heap-9.15-inplace' '-package-id ghc-internal-9.1500.0-inplace' '-package-id ghc-toolchain-0.1.0.0-inplace' '-package-id ghci-9.15-inplace' '-package-id hpc-0.7.0.2-inplace' '-package-id os-string-2.0.8-inplace' '-package-id process-1.6.26.1-inplace' '-package-id rts-1.0.3' '-package-id semaphore-compat-1.0.0-inplace' '-package-id stm-2.5.3.1-inplace' '-package-id time-1.15-inplace' '-package-id transformers-0.6.1.2-inplace' '-package-id unix-2.8.8.0-inplace' -i -i/home/luite/haskell/build/ghc.prof/_build/stage1/compiler/build -i/home/luite/haskell/build/ghc.prof/_build/stage1/compiler/build/autogen -i/home/luite/haskell/build/ghc.prof/compiler/ -Irts/include -I_build/stage1/compiler/build -I_build/stage1/compiler/build/. -Icompiler/. -I/home/luite/haskell/build/ghc.prof/libraries/process/include -I/home/luite/haskell/build/ghc.prof/_build/stage1/libraries/process/build/include -I/home/luite/haskell/build/ghc.prof/libraries/directory -I/home/luite/haskell/build/ghc.prof/_build/stage1/libraries/directory/build -I/home/luite/haskell/build/ghc.prof/libraries/unix/include -I/home/luite/haskell/build/ghc.prof/_build/stage1/libraries/unix/build/include -I/home/luite/haskell/build/ghc.prof/libraries/time/lib/include -I/home/luite/haskell/build/ghc.prof/_build/stage1/libraries/time/build/lib/include -I/home/luite/haskell/build/ghc.prof/libraries/containers/containers/include -I/home/luite/haskell/build/ghc.prof/_build/stage1/libraries/containers/containers/build/include -I/home/luite/haskell/build/ghc.prof/libraries/bytestring/include -I/home/luite/haskell/build/ghc.prof/_build/stage1/libraries/bytestring/build/include -I/home/luite/haskell/build/ghc.prof/libraries/ghc-internal/include -I/home/luite/haskell/build/ghc.prof/_build/stage1/libraries/ghc-internal/build/include -I/home/luite/haskell/build/ghc.prof/rts/include -I/home/luite/haskell/build/ghc.prof/_build/stage1/rts/build/include -optP-include -optP_build/stage1/compiler/build/autogen/cabal_macros.h -optP-DHAVE_INTERNAL_INTERPRETER -optP-DCAN_LOAD_DLL -outputdir _build/stage1/compiler/build -fdiagnostics-color=always -Wall -Wno-name-shadowing -Wnoncanonical-monad-instances -Wnoncanonical-monoid-instances -XGHC2021 -XNoImplicitPrelude -XMonoLocalBinds -no-global-package-db -package-db=/home/luite/haskell/build/ghc.prof/_build/stage1/inplace/package.conf.d -ghcversion-file=rts/include/ghcversion.h -ghcversion-file=rts/include/ghcversion.h -Wnoncanonical-monad-instances -optc-Wno-error=inline -c compiler/GHC/CmmToAsm/Reg/Linear.hs -o _build/stage1/compiler/build/GHC/CmmToAsm/Reg/Linear.p_o -fsplit-sections -haddock -Winvalid-haddock -Wno-deprecated-flags -Wcpp-undef -O -H64m -O2 -fprof-auto-calls -fprof-auto-calls
===> Command failed with error code: 1
ghc: panic! (the 'impossible' happened)
GHC version 9.15.20251204:
unariseExpr - app2
m_$wprocessBlock_sat_tkOs eta3_tkOb
Just MultiVal [us_glv3, us_glv4]
Call stack:
CallStack (from HasCallStack):
pprPanic, called at compiler/GHC/Stg/Unarise.hs:560:19 in ghc-9.15-inplace:GHC.Stg.Unarise
Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug
Command failed