[GHC] #14079: Failure to do CPR in the presence of a local letrec

GHC ghc-devs at haskell.org
Wed Aug 2 22:38:00 UTC 2017


#14079: Failure to do CPR in the presence of a local letrec
-------------------------------------+-------------------------------------
        Reporter:  nomeata           |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.3
      Resolution:                    |             Keywords:  JoinPoints
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 When `e` is small we don't to w/w; insteead we inline the function bodily
 at all call sites.

 If you make it bigger, thus
 {{{
 {-# NOINLINE dummy #-}
 dummy x = x

 e :: (Int, Int) -> Int -> Int -> (Int, Int)
 e x y n = je x y
  where
    je !x y | y > 0 = x
            | otherwise = je x (dummy y + dummy n)
 }}}
 then `e` is big enough, and full w/w happens. Actually it looks fine to
 me.   All the right things are happening.   So is ther a bug here at all?

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


More information about the ghc-tickets mailing list