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

GHC ghc-devs at haskell.org
Tue Oct 2 20:33:57 UTC 2018


#15696: Derived Ord instance for enumerations with more than 8 elements seems to be
incorrect
-------------------------------------+-------------------------------------
        Reporter:  mrkkrp            |                Owner:  (none)
            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:                    |  Differential Rev(s):  Phab:D5196
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by osa1):

 Thinking about this more. I think the only case where we can actually
 avoid entering the argument of `dataToTag#` is when the argument is a
 static closure. For anything else (a dynamic closure, a CAF) we need to
 enter it. I don't know how often people do `dataToTag# C` (for some
 constructor `C`), perhaps it's fine to always enter it. If it is then we
 can remove the special case for `dataToTag#` in CorePrep and in the
 codegen (in Cmm) we can just enter the argument.

 If we decide to do that then perhaps we should also revisit the `getTag`
 and remove the bang pattern on its argument.

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


More information about the ghc-tickets mailing list