[GHC] #7041: GHC.Real.gcdInt is no longer optimized.
GHC
cvs-ghc at haskell.org
Mon Jul 2 13:35:44 CEST 2012
#7041: GHC.Real.gcdInt is no longer optimized.
------------------------------+---------------------------------------------
Reporter: int-e | Owner:
Type: bug | Status: new
Priority: normal | Component: libraries/base
Version: 7.5 | Keywords:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
Failure: None/Unknown | Testcase:
Blockedby: | Blocking:
Related: |
------------------------------+---------------------------------------------
This is a regression since ghc-7.2, related to #5767. {{{GHC.Real}}}
defines
{{{
gcdInt :: Int -> Int -> Int
gcdInt a b = fromIntegral (gcdInteger (fromIntegral a) (fromIntegral b))
}}}
which used to optimize to {{{GHC.Integer.Type.gcdInt}}}. But since
{{{fromInteger = integerToInt}}} and {{{fromIntegral = smallInteger}}} are
no longer inlined, this optimization is lost. This results in unecessary
allocations.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7041>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list