Ticket #4924 (closed bug: fixed)
bizarre strictness analysis bug
| Reported by: | simonmar | Owned by: | |
|---|---|---|---|
| Priority: | high | Milestone: | 7.4.1 |
| Component: | Compiler | Version: | 7.1 |
| Keywords: | Cc: | ||
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | None/Unknown | Difficulty: | |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
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!
Change History
Note: See
TracTickets for help on using
tickets.
