[GHC] #14626: No need to enter a scrutinised value

GHC ghc-devs at haskell.org
Mon Jan 15 15:37:15 UTC 2018


#14626: No need to enter a scrutinised value
-------------------------------------+-------------------------------------
        Reporter:  heisenbug         |                Owner:  heisenbug
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.2
      Resolution:                    |             Keywords:  performance
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #13861            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by alexbiehl):

 Right, though `GHC.IO.Handle.Types`, which contains `Handle__`, has

 {{{
 {-# OPTIONS_GHC -funbox-strict-fields #-}
 }}}

 in its header.

 Given this, our example `data H = H !(IORef Char)` turns into

 {{{
 $WH
 $WH
   = \ dt_aV9 ->
       case dt_aV9 `cast` <Co:2> of { STRef dt_aVb -> H dt_aVb }
 }}}

 So we are indeed storing a `MutVar#` here.

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


More information about the ghc-tickets mailing list