[GHC] #4306: UNPACK can lead to unnecessary copying and wasted stack space

GHC ghc-devs at haskell.org
Sun Oct 14 20:05:14 UTC 2018


#4306: UNPACK can lead to unnecessary copying and wasted stack space
-------------------------------------+-------------------------------------
        Reporter:  Olathe            |         Owner:  (none)
            Type:  bug               |        Status:  closed
        Priority:  normal            |     Milestone:
       Component:  Compiler          |       Version:  6.12.3
      Resolution:  fixed             |      Keywords:
Operating System:  Unknown/Multiple  |  Architecture:  Unknown/Multiple
 Type of failure:  Runtime           |     Test Case:
  performance bug                    |  simplCore/should_compile/T4306
      Blocked By:                    |      Blocking:
-------------------------------------+-------------------------------------

Comment (by Krzysztof Gogolewski <krz.gogolewski@…>):

 In [changeset:"448b77b93b369745e9bfbc8b46a5b87bb73dd379/ghc"
 448b77b9/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="448b77b93b369745e9bfbc8b46a5b87bb73dd379"
 Add RubbishLit for absent bindings of UnliftedRep

 Summary:
 Trac #9279 reminded us that the worker wrapper transformation copes
 really badly with absent unlifted boxed bindings.

 As `Note [Absent errors]` in WwLib.hs points out, we can't just use
 `absentError` for unlifted bindings because there is no bottom to hide
 the error in.
 So instead, we synthesise a new `RubbishLit` of type
 `forall (a :: TYPE 'UnliftedRep). a`, which code-gen may subsitute for
 any boxed value. We choose `()`, so that there is a good chance that
 the program crashes instead instead of leading to corrupt data, should
 absence analysis have been too optimistic (#11126).

 Reviewers: simonpj, hvr, goldfire, bgamari, simonmar

 Reviewed By: simonpj

 Subscribers: osa1, rwbarton, carter

 GHC Trac Issues: #15627, #9279, #4306, #11126

 Differential Revision: https://phabricator.haskell.org/D5153
 }}}

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


More information about the ghc-tickets mailing list