id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,os,architecture,failure,difficulty,testcase,blockedby,blocking,related
3717,Superfluous seq no eliminated,rl,,"Program:
{{{
foo :: Int -> Int
foo 0 = 0
foo n = (if n < 5 then 1 else 2) `seq` foo (n-1)
}}}
GHC generates this code:
{{{
T.$wfoo =
  \ (ww_slm :: GHC.Prim.Int#) ->
    case ww_slm of ds_XkE {
      __DEFAULT ->
        case case GHC.Prim.<# ds_XkE 5 of _ {
               GHC.Bool.False -> lvl1_rlG; GHC.Bool.True -> lvl_rlE
             }
        of _ { __DEFAULT ->
        T.$wfoo (GHC.Prim.-# ds_XkE 1)
        };
      0 -> 0
    }
}}}
Note that the seq is still there although it is a nop. This actually occurs in stream fusion code.",bug,closed,normal,7.0.2,Compiler,6.13,fixed,,,Unknown/Multiple,Unknown/Multiple,Runtime performance bug,,simplCore/should_compile/T3717,,,
