Skip to content

lookupIdSubst panic with GHC 9.4.5

Summary

GHC 9.4.5 panics with lookupIdSubst when building a benchmark of my library.

[2 of 3] Compiling IGA              ( benchmark/IGA.hs, /tmp/haskell-floating-point/dist-newstyle/build/x86_64-linux/ghc-9.4.5/rounded-hw-0.3.0/build/rounded-hw-benchmark/rounded-hw-benchmark-tmp/IGA.o )

<no location info>: error:
    panic! (the 'impossible' happened)
  GHC version 9.4.5:
        lookupIdSubst
  df_sfFs
  InScope {$dUnbox_X0 $dIArray_Xf $dFractional_Xg $dIArray_adxd
           df_adxe $dUnbox_adxf $dFractional_adxs $dIArray_adxt df_adxu
           $dUnbox_adxv $sintervalGaussianEliminationU_ddPi
           $sintervalGaussianEliminationU_ddPj
           $sintervalGaussianEliminationU_ddPk intervalGaussianElimination
           intervalGaussianEliminationU benchmark $trModule $trModule_seOB
           $trModule_seOC $trModule_seOD $trModule_seOE loc_seOF loc_seOG
           loc_seOH loc_seOI loc_seOJ loc_seOK loc_seOL $dIP_seOM $dIP_seON
           $dIP_seOO loc_seRU loc_seRV loc_seRW loc_seRX loc_seRY loc_seRZ
           loc_seS0 $dIP_seS1 $dIP_seS2 $dIP_seS3 loc_seZA loc_seZB loc_seZC
           loc_seZD loc_seZE loc_seZF loc_seZG $dIP_seZH $dIP_seZI $dIP_seZJ
           benchmark_sfzR benchmark_sfzS}
  Call stack:
      CallStack (from HasCallStack):
        callStackDoc, called at compiler/GHC/Utils/Panic.hs:182:37 in ghc:GHC.Utils.Panic
        pprPanic, called at compiler/GHC/Core/Subst.hs:260:17 in ghc:GHC.Core.Subst

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

Error: cabal: Failed to build rounded-hw-0.3.0.

Steps to reproduce

$ git clone https://github.com/minoki/haskell-floating-point.git
$ cd haskell-floating-point/
$ cabal build -w ghc-9.4.5 --enable-benchmarks rounded-hw

Expected behavior

The benchmark should build fine.

Environment

  • GHC version used: 9.4.5

The GHC built from https://gitlab.haskell.org/ghc/ghc/-/commits/wip/9.4.6-backports/ is also affected, so this is a different issue from #22761 (closed).

Other series (9.2.x, 9.6.x, 9.8.1-alpha1) are not affected.

Optional:

  • Operating System: x86_64 and AArch64
  • System Architecture: Linux and macOS
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information