[GHC] #10613: Mechanism for checking that we only enter single-entry thunks once

GHC ghc-devs at haskell.org
Wed Jul 8 06:54:16 UTC 2015


#10613: Mechanism for checking that we only enter single-entry thunks once
-------------------------------------+-------------------------------------
              Reporter:  bgamari     |             Owner:
                  Type:  feature     |            Status:  new
  request                            |         Milestone:
              Priority:  normal      |           Version:  7.10.1
             Component:  Compiler    |  Operating System:  Unknown/Multiple
              Keywords:              |   Type of failure:  Other
          Architecture:              |        Blocked By:
  Unknown/Multiple                   |   Related Tickets:
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
 During this week's GHC call it came up that it would be nice to have a
 linting mechanism for verifying that we only enter single-entry thunks
 once, as currently this invariant appears to be completely unchecked.

 Currently we do not record whether a thunk is intended to be single-entry
 when we emit its code. Moreover, I don't believe there is any room for
 this left in the info table to record this fact. There are two ways I can
 think of accomodating this,

  * stealing a bit from the thunk type field
  * add a flags field to `StgDebugInfo` such that the lint requires the
 `debug` way

 As far as implementing the check itself, I think it should be rather
 straightforward. When we enter a thunk we simply want to check whether it
 is single-entry. If it is then we replace it with a special type of
 `BLACKHOLE`-like thunk which crashes the program (or merely emits a
 warning) on entry.

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


More information about the ghc-tickets mailing list