[GHC] #8585: Loopification should omit stack check

GHC ghc-devs at haskell.org
Sat Feb 1 13:37:47 UTC 2014


#8585: Loopification should omit stack check
--------------------------------------------+------------------------------
        Reporter:  jstolarek                |            Owner:  jstolarek
            Type:  bug                      |           Status:  new
        Priority:  normal                   |        Milestone:
       Component:  Compiler                 |          Version:  7.7
      Resolution:                           |         Keywords:
Operating System:  Unknown/Multiple         |     Architecture:
 Type of failure:  Runtime performance bug  |  Unknown/Multiple
       Test Case:                           |       Difficulty:  Unknown
        Blocking:                           |       Blocked By:
                                            |  Related Tickets:
--------------------------------------------+------------------------------

Comment (by Jan Stolarek <jan.stolarek@…>):

 In [changeset:"ea584ab634b17b499138bc44dbec777de7357c19/ghc"]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="ea584ab634b17b499138bc44dbec777de7357c19"
 Loopification jump between stack and heap checks

 Fixes #8585

 When emmiting label of a self-recursive tail call (ie. when
 performing loopification optimization) we emit the loop header
 label after a stack check but before the heap check. The reason is
 that tail-recursive functions use constant amount of stack space
 so we don't need to repeat the check in every loop. But they can
 grow the heap so heap check must be repeated in every call.
 See Note [Self-recursive tail calls] and [Self-recursive loop header].
 }}}

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


More information about the ghc-tickets mailing list