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 631
    • Merge requests 631
  • 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
  • #22272

GHC simplifier loops

In a situation that feels similar to #22112 (closed), the output of the Prep stage loops when processing a recursive definition. The big difference is that I haven't been able to reproduce this using GHC-as-a-program, because it requires saving to and then loading back from an interface file-ish representation.

The attached program compiles with GHC as of 161a6f1f and when run, typechecks and compiles up to Tidy a small program that contains a recursive definition. The Tidy binding is saved into a file alongside the ModIface. Afterwards, in a fresh GHC session, the ModIface and the binding is loaded, and then the binding is processed by Prep. When we try to print the length of the binds returned by Prep, we loop.

Main.hs A.hs

Similar to #22112 (closed), this only happens when unfoldings are preserved, and when the definition in the input file is recursive. Opt_NoTypeBinds is only turned on to make it easier to process the resulting binds; unlike all other settings in setup, that one is not essential to reproduce the problem.

Edited Oct 11, 2022 by Gergő Érdi
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking