Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 5.5k
    • Issues 5.5k
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 633
    • Merge requests 633
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Model experiments
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #22662

GHC panic with -O -fno-cpr-anal -fno-cse -fno-full-laziness

Summary

Panic in GHC 9.4.3 when compiling 4-line program with -O -fno-cpr-anal -fno-cse -fno-full-laziness. No panic occurs on 9.2.5.

Steps to reproduce

Put the following code in a file named Bug.hs

module Bug where

import Data.Set

foo x = sequence_ [ f y | y <- x ]
  where f _ = return (fromList [0])

Now, on the command line:

$ ghc -O -fno-cpr-anal -fno-cse -fno-full-laziness Bug.hs
[1 of 1] Compiling Bug              ( Bug.hs, Bug.o )

<no location info>: error:
    panic! (the 'impossible' happened)
  GHC version 9.4.3:
	completeCall
  conrep_X1
  Stop[BoringCtxt] Integer
  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/Opt/Simplify.hs:1911:9 in ghc:GHC.Core.Opt.Simplify

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

Removing any of the command-line flags seems to cause the panic to disappear.

Expected behavior

Compile without a panic.

(Why the strange combination of flags? One of our larger source files takes a long time to compile unless cpr-anal is turned off. The other options are there for historic reasons and not really needed, but still I thought I'd report the bug in case in shows up in other ways.)

Environment

  • GHC version used: 9.4.3

Optional:

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