[GHC] #11572: BangPatterns-related behavior regressions on GHC 8.0

#11572: BangPatterns-related behavior regressions on GHC 8.0 -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: bug | Status: new Priority: highest | Milestone: 8.0.1 Component: Compiler | Version: 8.0.1-rc2 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- When you compile this code: {{{#!hs {-# LANGUAGE BangPatterns #-} main :: IO () main = let !_ = (undefined :: ()) in print 2 }}} with GHC 8.0.1-rc2 with any level of optimizations, it will print `2` instead of throwing `undefined` like GHC 7.10.3 does. Note that changing `undefined :: ()` to something like `undefined :: Int#` is enough to invoke `undefined` when compiled, but if you run this code in GHCi: {{{ λ> :set -XMagicHash -XBangPatterns λ> import GHC.Prim λ> let !_ = (undefined :: Int#) in print 2 }}} You get something even stranger: {{{ ghc: panic! (the 'impossible' happened) (GHC version 8.0.0.20160204 for x86_64-unknown-linux): dsLet: unlifted !_ = (undefined :: Int#) print @ Integer $dShow_a2ky 2 Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11572 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11572: BangPatterns-related behavior regressions on GHC 8.0 -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: bug | Status: new Priority: highest | Milestone: 8.0.1 Component: Compiler | Version: 8.0.1-rc2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): Another strange facet of the GHCi portion of the bug: the behavior is different depending on whether a wildcard or a named type variable is used. Here's another bizarre error you can get in GHCi (but not compiled code): {{{ λ> :set -XMagicHash -XBangPatterns λ> import GHC.Prim λ> let !a = (undefined :: Int#) in print 2 <interactive>:3:5: error: • You can't mix polymorphic and unlifted bindings !a = (undefined :: Int#) Probable fix: add a type signature • In the expression: let !a = (undefined :: Int#) in print 2 In an equation for ‘it’: it = let !a = (undefined :: Int#) in print 2 }}} This works without issue in GHCi 7.10.3. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11572#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11572: BangPatterns-related behavior regressions on GHC 8.0
-------------------------------------+-------------------------------------
Reporter: RyanGlScott | Owner:
Type: bug | Status: new
Priority: highest | Milestone: 8.0.1
Component: Compiler | Version: 8.0.1-rc2
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Simon Peyton Jones

#11572: BangPatterns-related behavior regressions on GHC 8.0 -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: bug | Status: merge Priority: highest | Milestone: 8.0.1 Component: Compiler | Version: 8.0.1-rc2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | deSugar/should_run/T11572 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => merge * testcase: => deSugar/should_run/T11572 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11572#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11572: BangPatterns-related behavior regressions on GHC 8.0 -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: bug | Status: closed Priority: highest | Milestone: 8.0.1 Component: Compiler | Version: 8.0.1-rc2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | deSugar/should_run/T11572 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged in d6ea90a213fb32ea0af666dec25697228cc09a26. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11572#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC