[GHC] #9238: Negative zero broken

GHC ghc-devs at haskell.org
Tue Jul 29 07:23:21 UTC 2014


#9238: Negative zero broken
-------------------------------------+-------------------------------------
              Reporter:  augustss    |            Owner:
                  Type:  bug         |           Status:  new
              Priority:  normal      |        Milestone:
             Component:  Compiler    |          Version:  7.8.2
            Resolution:              |         Keywords:
      Operating System:              |     Architecture:  Unknown/Multiple
  Unknown/Multiple                   |       Difficulty:  Unknown
       Type of failure:  Incorrect   |       Blocked By:
  result at runtime                  |  Related Tickets:
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 I can tell you exactly where it's created: line 2107 of `Simplify.lhs` (in
 today's HEAD), in function `simplAlt`.

 However I'm suspicious of adding a special case for float/double here.
 Rather, I think we should prohibit using Core-language `case` expressions
 to scrutinise float/double, so that `case` (in Core) behaves in a simple,
 predictable way.

 Rather I think we should probably generate
 {{{
    case eqDouble# ds1 0.0## of
      True -> ...
      False -> ...
 }}}
 (or, rather, today's unboxed-boolean version).  Now the magic is confined
 to how `eqDouble#` is implemented, which is the proper place for it.

 Now Haskell source code does allow case expressions over floats, but
 that's just a question of fixing the desugarer.

 Does that make sense?  Does anyone feel like taking this on?

 Simon

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


More information about the ghc-tickets mailing list