[GHC] #14434: GHC 8.2.1 picks wrong instances with -O in a presence of an OVERLAPPABLE instance

GHC ghc-devs at haskell.org
Tue Nov 7 09:20:11 UTC 2017


#14434: GHC 8.2.1 picks wrong instances with -O in a presence of an OVERLAPPABLE
instance
-------------------------------------+-------------------------------------
           Reporter:  dredozubov     |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.2.1
           Keywords:                 |  Operating System:  Linux
       Architecture:  x86_64         |   Type of failure:  Incorrect result
  (amd64)                            |  at runtime
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 We experienced code breakage while moving to 8.2.1 - in some circumstances
 it picks wrong instances if an instance in the lines of `instance {-#
 OVERLAPPABLE #-} C a ` is defined. @s9gf4ult was really nice to create a
 repo demonstrating an issue, you can look at the repo here:
 [https://github.com/s9gf4ult/isogen-minimal-example]

 Running `chech.sh` will trigger three builds:


 {{{
 GHC 8.0.2, -O, succeeds
 GHC 8.2.1, -O0, succeeds
 GHC 8.2.1, -O, fails
 }}}



 If you'll check out to either of fix- branches:


 {{{
 fix-move-to_string
 fix-no-catchall-instance
 fix-replace-to_string
 fix-add-irrelevant-instance
 }}}

 then the last test should succeed also. Those branches contain changes
 over master which fixes the bug in different ways.

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


More information about the ghc-tickets mailing list