#4924: bizarre strictness analysis bug
---------------------------------+------------------------------------------
    Reporter:  simonmar          |        Owner:              
        Type:  bug               |       Status:  new         
    Priority:  high              |    Milestone:  7.2.1       
   Component:  Compiler          |      Version:  7.1         
    Keywords:                    |     Testcase:              
   Blockedby:                    |   Difficulty:              
          Os:  Unknown/Multiple  |     Blocking:              
Architecture:  Unknown/Multiple  |      Failure:  None/Unknown
---------------------------------+------------------------------------------
 This module:

 {{{
 module Test where

 f :: Int -> Int -> Int
 f 0 t = t
 f i t = f (i-1) (t+1)

 g :: Int -> Int -> Int
 g 0 t = t
 g i t = g (i-1) (t+1)
 }}}

 contains two identical functions, `f` and `g`.  If we compile with `-O2
 -dverbose-core2core` using HEAD, GHC derives different strictness for
 them:

 {{{
 Test.f [Occ=LoopBreaker]
   :: GHC.Types.Int -> GHC.Types.Int -> GHC.Types.Int
  ...
  Str=DmdType U(L)U(L)m,

 Test.g [Occ=LoopBreaker]
   :: GHC.Types.Int -> GHC.Types.Int -> GHC.Types.Int
   ...
  Str=DmdType U(L)L,
 }}}

 The strictness on `g` is wrong (it should be strict in both arguments).

 What is even more bizarre is that if you DELETE `f`, then `g` gets the
 correct strictness!

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

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to