Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,390
    • Issues 4,390
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 373
    • Merge Requests 373
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #18227

Closed
Open
Opened May 24, 2020 by vdukhovni@trac-vdukhovniDeveloper

"GHC.StgToCmm.Env: variable not found" (perhaps related to #17871)

Summary

Panic when compiling a module with -fno-enable-rewrite-rules (GHC 8.11.0.20200523)

 ghc: panic! (the 'impossible' happened)
  (GHC version 8.11.0.20200523:
        GHC.StgToCmm.Env: variable not found
  wild3_s1Hj
  local binds for:
  kilter_ipv4
  kilter2
  ipv1_s1Hb
  wild1_s1Hc
  wild2_s1Hd
  x1_s1He
  lwild1_s1Hf
  ipv6_s1Hi
  Call stack:
      CallStack (from HasCallStack):
        callStackDoc, called at compiler/GHC/Utils/Outputable.hs:1221:37 in ghc:GHC.Utils.Outputable
        pprPanic, called at compiler/GHC/StgToCmm/Env.hs:152:9 in ghc:GHC.StgToCmm.Env

This is a stripped-down version of a failure to build the bytestring test-suite.

[ FWIW, the same example also triggers panics in GHC 8.6.5 and GHC 8.8.3 even without -fno-enable-rewrite-rules: #18228 (closed) ]

Steps to reproduce

ghc -O Lib -fno-enable-rewrite-rules with Lib.hs as below (also attached Lib.hs)

module Lib (kilter) where
import Data.ByteString.Internal

kilter :: ByteString -> IO ByteString
kilter ps@(PS x _ _) = createAndTrim 1 $ const $ pure 1

Expected behavior

No panic

Environment

  • GHC version used: 8.11.0.20200523

Optional:

  • Operating System: FreeBSD 12.0
  • System Architecture: x86_64
Edited May 24, 2020 by vdukhovni
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#18227