[GHC] #15155: How untagged pointers sneak into banged fields

GHC ghc-devs at haskell.org
Tue Oct 9 20:08:51 UTC 2018


#15155: How untagged pointers sneak into banged fields
-------------------------------------+-------------------------------------
        Reporter:  heisenbug         |                Owner:  heisenbug
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.8.1
       Component:  Compiler          |              Version:  8.4.2
      Resolution:                    |             Keywords:  CodeGen
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:  14677
 Related Tickets:  #13027 #7308      |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonmar):

 Just to write down what @simonpj and I discussed earlier today: it *would*
 be possible to ensure that a strict field of a constructor always points
 to a tagged value, by employing the same method we now use for
 `dataToTag#` (see Phab:D5201), namely have the code generator inject an
 eval for each strict field when building the constructor. The eval could
 be omitted in cases where the codegen can see that the value for the field
 is already a tagged value, these cases could include:
 * it's a constructor we just built
 * it's a case binder
 * the value was read from another strict constructor

 However, the extra eval would likely remain in many cases. But evals are
 cheap - just a tag test in the common case. Whether this ends up being a
 win or not is hard to say, it would be a good experiment to do though.

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


More information about the ghc-tickets mailing list