#3717: Superfluous seq no eliminated
---------------------------------+------------------------------------------
Reporter: rl | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler
Version: 6.13 | Resolution:
Keywords: | Difficulty:
Os: Unknown/Multiple | Testcase: simplCore/should_compile/T3717
Architecture: Unknown/Multiple | Failure: Runtime performance bug
Patch: 0 |
---------------------------------+------------------------------------------
Changes (by rl):
* status: closed => new
* resolution: fixed =>
* patch: => 0
Comment:
While the patch fixes the original example, it doesn't help here:
{{{
foo :: Int -> Int -> Int -> Int
foo x y n = compare x y `seq` n
}}}
This generates:
{{{
T.foo =
\ (x_aai :: GHC.Types.Int)
(y_aaj :: GHC.Types.Int)
(n_aak :: GHC.Types.Int) ->
case x_aai of _ { GHC.Types.I# x#_afF [Dmd=Just L] ->
case y_aaj of _ { GHC.Types.I# y#_afJ [Dmd=Just L] ->
case case GHC.Prim.<# x#_afF y#_afJ of _ {
GHC.Bool.False ->
case GHC.Prim.==# x#_afF y#_afJ of _ {
GHC.Bool.False -> GHC.Ordering.GT; GHC.Bool.True ->
GHC.Ordering.EQ
};
GHC.Bool.True -> GHC.Ordering.LT
}
of _ { __DEFAULT ->
n_aak
}
}
}
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3717#comment:2>
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