Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,249
    • Issues 5,249
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 578
    • Merge requests 578
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • 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
  • #8456
Closed
Open
Issue created Oct 18, 2013 by Jan Stolarek@jstolarek

Control flow optimisations duplicate blocks

During work on #8275 (closed) I observed that control flow optimisation pass in the Cmm pipeline duplicates block that does the stack check, which is completely redundant. There is at least one bug in !CmmContFlowOpt module. Consider this:

L1: goto L2
L2: whatever
L3: goto L1

We are processing blocks from the end. When we reach L3 first guard in maybe_concat function (!CmmContFlowOpt.hs, line 123) will turn that blocks into:

L1: goto L2
L2: whatever
L3: goto L2

However, the number of predecessors of L2 block is not updated because backEdges is computed once before we run maybe_concat and is not updated when we make changes to the block structure.

Another issue, which I have not yet encountered in practice but I believe may arise as well, comes from the fact that we may map one label to a different one, but again we don't that take into account when determining the number of predecessors.

Trac metadata
Trac field Value
Version 7.7
Type Bug
TypeOfFailure OtherFailure
Priority high
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking