Skip to content

GitLab

  • Menu
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 4,869
    • Issues 4,869
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 453
    • Merge requests 453
  • 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 Compiler
  • GHCGHC
  • Issues
  • #19430
Closed
Open
Created Feb 24, 2021 by Ben Gamari@bgamari🐢Maintainer

GivenCheck fails in hpc way

Currently the GivenCheck and GivenCheckSwap tests fail in the hpc way. GivenCheck is supposed to verify that a simple program with unreachable code throws an unreachable code warning:

type family S x

f :: a -> S a
f = undefined

g :: S a ~ Char => a -> Char
g y   | False           = f y
      | otherwise       = 'a'

In the normal way the case of g produces the following pre-optimised Core (-ddump-ds-preopt):

        case GHC.Types.False of wild_00 {
          False -> fail_dKd GHC.Prim.void#;
          True ->
            (f @a_aHn y_auo) `cast` (Sub co_aI6 :: S a_aHn[sk:1] ~R# Char)
        }
      }

However, in the hpc way it produces:

        case hpc<GivenCheckSwapMain,4>
             case GHC.Types.False of t1_dKd {
               False -> hpc<GivenCheckSwapMain,3> GHC.Types.False;
               True -> hpc<GivenCheckSwapMain,2> GHC.Types.True
             }
        of wild_00 {
          False -> fail_dKg GHC.Prim.void#;
          True ->
            hpc<GivenCheckSwapMain,6>
            (f @a_aHn (hpc<GivenCheckSwapMain,5> y_auo))
            `cast` (Sub co_aI6 :: S a_aHn[sk:1] ~R# Char)
        }

This is enough to hide the fact that the case is unreachable from the pattern match checker.

Edited Feb 24, 2021 by Ben Gamari
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking