[GHC] #15696: Derived Ord instance for enumerations with more than 8 elements seems to be incorrect

GHC ghc-devs at haskell.org
Fri Dec 7 14:59:00 UTC 2018


#15696: Derived Ord instance for enumerations with more than 8 elements seems to be
incorrect
-------------------------------------+-------------------------------------
        Reporter:  mrkkrp            |                Owner:  osa1
            Type:  bug               |               Status:  patch
        Priority:  highest           |            Milestone:  8.6.2
       Component:  Compiler          |              Version:  8.6.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Incorrect result  |  Unknown/Multiple
  at runtime                         |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #14677, #15155    |  Differential Rev(s):  Phab:D5196,
       Wiki Page:                    |  Phab:D5201, Phab:D5226
-------------------------------------+-------------------------------------

Comment (by Simon Peyton Jones <simonpj@…>):

 In [changeset:"f334d20e00e3f4bd217e49216b7e9d9c8779db10/ghc"
 f334d20e/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="f334d20e00e3f4bd217e49216b7e9d9c8779db10"
 Careful tweaking to exprOkForSpeculation

 This patch does several things:

 * Make exprOkForSpeculation ignore evaluatedness of variables
   See the Note [exprOkForSpeculation and evaluated variables]
   This means that the binder-swap transformation no longer
   invaliates the let/app invariant.

 * Make exprOkForSpeculation return False for
      DataToTagOp and SeqOp.
   See Note [exprOkForSpeculation and SeqOp/DataToTagOp]

 * Remove the 'can_fail' property from dataToTag#; it was
   always a hack (described in the old Note [dataToTag#] in
   primops.txt.pp), and now its not necessary because of the
   fixes above.

 * Make SetLevels use exprIsHNF, /not/ exprOkForSpeculation,
   when floating single-alternative cases.  See SetLevels
   Note [Floating single-alternative cases]

 * Fix a buglet in FloatIn; probably never bites in practice
   See Note [Dead bindings]

 Collectively, these changes finally fix Trac #15696.
 }}}

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


More information about the ghc-tickets mailing list