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

#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

#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: high | Milestone: 8.2.3 Component: Compiler | Version: 8.2.1 Resolution: | 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: | -------------------------------------+------------------------------------- Changes (by bgamari): * priority: normal => high * milestone: => 8.2.3 Comment: Hmm, this looks pretty bad. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14434#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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: high | Milestone: 8.2.3 Component: Compiler | Version: 8.2.1 Resolution: | 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: | -------------------------------------+------------------------------------- Comment (by simonpj): Don't worry -- I'm on this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14434#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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: high | Milestone: 8.2.3 Component: Compiler | Version: 8.2.1 Resolution: | 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: | -------------------------------------+------------------------------------- Description changed by dredozubov: Old description:
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.
New description: 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 fix the application behavior in different ways. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14434#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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: high | Milestone: 8.2.3 Component: Compiler | Version: 8.2.1 Resolution: | 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: | -------------------------------------+------------------------------------- Comment (by simonpj): This is more fallout from `-fsolve-constant-dicts` see #12791. I have a fix. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14434#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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: high | Milestone: 8.2.3
Component: Compiler | Version: 8.2.1
Resolution: | 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: |
-------------------------------------+-------------------------------------
Comment (by Simon Peyton Jones

#14434: GHC 8.2.1 picks wrong instances with -O in a presence of an OVERLAPPABLE instance -------------------------------------+------------------------------------- Reporter: dredozubov | Owner: (none) Type: bug | Status: merge Priority: high | Milestone: 8.2.3 Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 | (amd64) Type of failure: Incorrect result | Test Case: at runtime | typecheck/should_compile/T14434 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * testcase: => typecheck/should_compile/T14434 * status: new => merge Comment: Thank you for such a small repro case. Can you confirm that this patch fixes your actual application? Merge to 8.2.3 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14434#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14434: GHC 8.2.1 picks wrong instances with -O in a presence of an OVERLAPPABLE instance -------------------------------------+------------------------------------- Reporter: dredozubov | Owner: (none) Type: bug | Status: merge Priority: high | Milestone: 8.2.3 Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 | (amd64) Type of failure: Incorrect result | Test Case: at runtime | typecheck/should_compile/T14434 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by dredozubov): Thanks for the fix! Unfortunately I was unable to build our application with ghc HEAD due to broken dependencies. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14434#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14434: GHC 8.2.1 picks wrong instances with -O in a presence of an OVERLAPPABLE instance -------------------------------------+------------------------------------- Reporter: dredozubov | Owner: (none) Type: bug | Status: closed Priority: high | Milestone: 8.4.1 Component: Compiler | Version: 8.2.1 Resolution: fixed | Keywords: Operating System: Linux | Architecture: x86_64 | (amd64) Type of failure: Incorrect result | Test Case: at runtime | typecheck/should_compile/T14434 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed * milestone: 8.2.3 => 8.4.1 Comment: There won't be a 8.2.3 at this point. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14434#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC