#7237: CgCase fails with strict data/functions
------------------------------+---------------------------------------------
 Reporter:  jwlato            |          Owner:                  
     Type:  bug               |         Status:  new             
 Priority:  normal            |      Component:  Compiler        
  Version:  7.6.1             |       Keywords:                  
       Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
  Failure:  None/Unknown      |       Testcase:                  
Blockedby:                    |       Blocking:                  
  Related:                    |  
------------------------------+---------------------------------------------
 The following code results in a ghc panic when compiled with -O or above:

 {{{
 -- Test.hs
 module Test where

 import Data.List (foldl')

 data SPair = SPair { pX, pY :: Double } deriving (Eq,Show)

 data AList = AList
     { pairs :: [SPair] } deriving Show

 rnf' :: AList -> ()
 rnf' aList = foldl' (flip seq) () (pairs aList) `seq` ()

 {- -- this works
 rnf' :: AList -> ()
 rnf' aList = foldl (flip seq) () (pairs aList) `seq` ()
 -}
 }}}

 The resulting error is

 {{{
 $ ghc -O Test.hs
 [1 of 1] Compiling Test             ( Test.hs, Test.o )
 ghc: panic! (the 'impossible' happened)
   (GHC version 7.6.1 for x86_64-unknown-linux):
         compiler/codeGen/CgCase.lhs:572:15-61: Irrefutable pattern failed
 for pattern ((CoreSyn.DEFAULT,

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

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to