Skip to content

Parallel array comprehension related crash

The following code panics with both 6.2 and the Debian
ghc-cvs snapshot. The problem appears to be in
the comprehension.

{-# OPTIONS -fparr -fglasgow-exts #-}
module Main (main) where

import GHC.PArr

ary = let arr1 = toP [1..10]
	  arr2 = toP [1..10]
	  f = [: i1 + i2 | i1 <- arr1 | i2 <- arr2 :]
	  in f !: 1

main = print ary

and the error (from the cvs snapshot):

ghc-6.3: panic! (the `impossible' happened, GHC version
6.3):
        applyTypeToArgs
    GHCziPArr.mapP{v} {- 01l -}
      @ (GHCziBase.Z0T{tc} {- (w) 40 -},
GHCziNum.Integer{tc} {- 314 -})
      (\ (ds{v}_d1On T :: (GHCziBase.Z0T{tc} {- (w) 40 -},
                           GHCziNum.Integer{tc} {- 314
-})) ->
         case ds{v}_d1On
         of wild{v}_B1 T { (ds{v}_d1Ot T, i2{v} {- v
aAO -} T) ->
         case ds{v}_d1Ot of wild{v}_B1 T { () ->
         let {
           ds{v}_d1OB T :: GHCziBase.Z0T{tc} {- (w) 40 -}
           ds{v}_d1OB = __letrec { } in 
GHCziBase.Z0T{v} {- (w) 71 -}
         } in  (ds{v}_d1On, ds{v}_d1OB)
         }
         })
      (GHCziPArr.crossP{v} {- 01o -}
         @ GHCziBase.Z0T{tc} {- (w) 40 -}
         @ GHCziNum.Integer{tc} {- 314 -}
         (GHCziPArr.replicateP{v} {- 01k -}
            @ GHCziBase.Z0T{tc} {- (w) 40 -}
            (GHCziBase.Izh{v} {- (w) 6d -} 1)
            GHCziBase.Z0T{v} {- (w) 71 -})
         (GHCziPArr.filterP{v} {- 01m -}
            @ GHCziNum.Integer{tc} {- 314 -}
            (\ (ds{v}_d1Oj T :: GHCziNum.Integer{tc} {-
314 -}) ->
               let {
                 i2{v} {- v aAO -} T ::
GHCziNum.Integer{tc} {- 314 -}
                 i2{v} {- v aAO -} = ds{v}_d1Oj
               } in  GHCziBase.True{v} {- (w) 6v -})
            arr2{v} {- v aAA -}))

Please report it as a compiler bug to
glasgow-haskell-bugs@haskell.org,
or http://sourceforge.net/projects/ghc/.
Trac metadata
Trac field Value
Version None
Type Bug
TypeOfFailure OtherFailure
Priority low
Resolution ResolvedFixed
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