Skip to content

GHC Panic on import with 'OPTIONS_GHC -fobject-code -O'

I get

> :l Test.hs
[1 of 1] Compiling Main             ( Test.hs, interpreted )
ghc: panic! (the 'impossible' happened)
  (GHC version 7.10.2 for x86_64-apple-darwin):
	floatExpr tick break<11>()

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

with Test.hs:

{-# OPTIONS_GHC -fobject-code -O #-}

import Control.Exception (assert)
import Data.Char (ord)

f :: String -> String
f s = assert (all (`elem` letters) s) $ (letters!!) <$> (ix <$> s)
    where
        ix ch = (ord ch - ord 'A')
        letters = ['A'..'Z']

OSX 10.11, GHC 7.10.2; uad-core 64-bit haswell; Homebrew GHC

Trac metadata
Trac field Value
Version 7.10.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information