[GHC] #11572: BangPatterns-related behavior regressions on GHC 8.0
GHC
ghc-devs at haskell.org
Sat Feb 13 00:26:51 UTC 2016
#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
More information about the ghc-tickets
mailing list