[GHC] #7858: Fix definitions of abs/signum for Floats/Doubles

GHC ghc-devs at haskell.org
Mon Aug 4 13:49:42 UTC 2014


#7858: Fix definitions of abs/signum for Floats/Doubles
-------------------------------------+-------------------------------------
              Reporter:  lerkok      |            Owner:
                  Type:  bug         |           Status:  patch
              Priority:  normal      |        Milestone:
             Component:              |          Version:  7.6.3
  libraries/base                     |         Keywords:  floating point
            Resolution:              |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Unknown
  Unknown/Multiple                   |       Blocked By:
       Type of failure:              |  Related Tickets:  #9238
  None/Unknown                       |
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
Changes (by rwbarton):

 * related:   => #9238


Comment:

 Oh I know why. See #9238. `signum` looks something like
 {{{
 \(D# x) -> case x of {
   __DEFAULT__ -> ...
   0.0 -> x
 }
 }}}
 and at `-O1` and higher, `x` is inlined to `0` in the right-hand side of
 the second case alternative.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/7858#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list