[GHC] #6121: Very poor constant folding
GHC
cvs-ghc at haskell.org
Wed May 23 11:22:19 CEST 2012
#6121: Very poor constant folding
-------------------------------------+--------------------------------------
Reporter: augustss | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler
Version: 7.4.1 | Keywords:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
Failure: Runtime performance bug | Testcase:
Blockedby: | Blocking:
Related: |
-------------------------------------+--------------------------------------
GHC seems to lack constant folding for encodeFloat/decodeFloat.
For many examples, compile the numeric-limits package on hackage, or just
this snippet:
{{{
epsilon :: Double
epsilon = r
where r = 1 - encodeFloat (m-1) e
(m, e) = decodeFloat (1 `asTypeOf` r)
}}}
This has a very simple value, but GHC refuses to compute it at compile
time. This in turn inhibits other constant folding that should be going
on.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/6121>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list