[GHC] #14090: Static pointers are not being registered under certain conditions

GHC ghc-devs at haskell.org
Fri Aug 4 20:17:42 UTC 2017


#14090: Static pointers are not being registered under certain conditions
-------------------------------------+-------------------------------------
           Reporter:  mnislaih       |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.2.1
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 It seems that if the module is compiled with -O2 only the static pointers
 in the module export list survive the Simplifier. This is a regression.

 {{{
 {-# 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
 }}}

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14090>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list