[GHC] #13331: Worker/wrapper can lead to sharing failure

GHC ghc-devs at haskell.org
Fri Feb 24 16:17:53 UTC 2017


#13331: Worker/wrapper can lead to sharing failure
-------------------------------------+-------------------------------------
        Reporter:  dfeuer            |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.4.1
       Component:  Compiler          |              Version:  8.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Runtime           |  Unknown/Multiple
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by dfeuer):

 `ptrEq` is indeed a thin wrapper around `reallyUnsafePtrEquality#`:

 {{{#!hs
 ptrEq :: a -> a -> Bool
 ptrEq x y = tagToEnum# (reallyUnsafePtrEquality# x y)
 }}}

 If it's really hard to work this out automatically, I wonder if it could
 be made a little easier with a pragma. I'd be satisfied if I could write
 something like

 {{{#!hs
     go :: Ord k => {-# NOUNPACK #-} k -> k -> a -> Map k a -> Map k a
 }}}

 to indicate that GHC should not unbox the first argument. Would that make
 it easier to avoid the problem? I'd hate to leave something as fragile-
 looking as my workaround hack in `containers` forever.

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


More information about the ghc-tickets mailing list