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,273
    • Issues 4,273
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 413
    • Merge Requests 413
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #17334

Closed
Open
Opened Oct 09, 2019 by Bodigrim@BodigrimDeveloper

GHC can't find weight for edge that should have one

Summary

GHC panics while compiling fetchAndIntArray# / fetchOrIntArray#.

[ 5 of 13] Compiling Data.Bit.MutableTS
ghc: panic! (the 'impossible' happened)
  (GHC version 8.8.1 for x86_64-apple-darwin):
  Can't find weight for edge that should have one
  triple (nQaY, nQwj, sKLs)
  updates [(cPjA, nQwR, sL5U), (cPjx, nQwQ, sL5U),
           ...
           (cOPS, nQwl, sKKV), (cOPy, nQwk, sKLs), (nQaY, nQwj, sKLs),
           ...
           (cOEj, nQv2, sKED), (cOEm, nQv1, sKED)]
  Call stack:
      CallStack (from HasCallStack):
        callStackDoc, called at compiler/utils/Outputable.hs:1159:37 in ghc:Outputable
        pprPanic, called at compiler/nativeGen/CFG.hs:423:11 in ghc:CFG

Steps to reproduce

git clone https://github.com/Bodigrim/bitvec.git
git checkout bc84af009921802106239d5e963e00abd1ec7003
stack build 

This will fail with an error message, quoted above.

Sorry for such a broad description; at the moment I do not have time to whittle it down. I suspect that the problematic piece is in Data.Bit.InternalTS:

let W# andMask# = hiMask lenMod
    W# orMask#  = x .&. loMask lenMod
primitive $ \state ->
  let !(# state',  _ #) = fetchAndIntArray# mba loIx# (word2Int# andMask#) state  in
    let !(# state'', _ #) = fetchOrIntArray#  mba loIx# (word2Int# orMask#)  state' in
      (# state'', () #)

Expected behavior

I expect this package to compile successfully.

Environment

  • GHC version used: 8.8.1 for x86_64-apple-darwin

It seems to be a regression since GHC 8.6.5, as witnessed by these Travis builds:

  • GHC 8.6.5: https://travis-ci.org/Bodigrim/bitvec/jobs/595834070
  • GHC 8.8.1: https://travis-ci.org/Bodigrim/bitvec/jobs/595834069
Edited Oct 09, 2019 by Bodigrim
Assignee
Assign to
8.8.2
Milestone
8.8.2 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#17334