[GHC] #14295: tagToEnum# leads to some silly closures
GHC
ghc-devs at haskell.org
Thu Sep 28 08:09:31 UTC 2017
#14295: tagToEnum# leads to some silly closures
-------------------------------------+-------------------------------------
Reporter: dfeuer | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone: 8.4.1
Component: Compiler | Version: 8.2.1
Resolution: | Keywords: datacon-tags
Operating System: Unknown/Multiple | Architecture:
Type of failure: Runtime | Unknown/Multiple
performance bug | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by dfeuer):
Replying to [comment:6 simonpj]:
> > Unsurprisingly, exactly the same thing is true for quotInt# and such.
>
> I don't understand. Can you explain?
{{{#!hs
foo :: (Int -> a) -> Int# -> Int# -> a
foo f x y = f (I# (quotInt# x y))
}}}
will suspend the division for fear of a zero denominator. We can fix that
similarly by testing for 0 and forcing the division in the good branch.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14295#comment:7>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list