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,260
    • Issues 4,260
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 398
    • Merge Requests 398
  • 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
  • #14090

Closed
Open
Opened Aug 04, 2017 by mnislaih@trac-mnislaih

Static pointers are not being registered under certain conditions

It seems that only the static pointers in the module export list survive the Simplifier. This is a regression which doesn't seem to affect ghci/runghc only compiled code.

{-# LANGUAGE StaticPointers #-}

import GHC.StaticPtr

staticHello :: StaticPtr String
staticHello = static "hello"

main = do
  keys <- staticPtrKeys
  if null keys
    then error "static ptrs are not being registered"
    else putStrLn "Everything is fine"
pepe:~/scratch$ stack --resolver ghc-8.2.1 script --optimize bug-spt.hs  
Using resolver: ghc-8.2.1 specified on command line
bug-spt: static ptrs are not being registered
CallStack (from HasCallStack):
  error, called at bug-spt.hs:11:10 in main:Main
pepe:~/scratch$ stack --resolver ghc-8.0.2 script --optimize bug-spt.hs  
Using resolver: ghc-8.0.2 specified on command line
Everything is fine
Edited Mar 10, 2019 by mnislaih
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#14090