[GHC] #12212: GHC 8.0.1 crash

GHC ghc-devs at haskell.org
Mon Jun 20 12:25:42 UTC 2016


#12212: GHC 8.0.1 crash
-------------------------------------+-------------------------------------
        Reporter:  dibblego          |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Linux             |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash                              |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  9160, 10602       |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by bgamari):

 Interesting. Indeed I can reproduce this with both `-O1` and `-O2`. Thanks
 for the report!

 It looks like the two term-level binders

 Here is a more minimal testcase reproducing the issue with only
 `dimensional` (install with `cabal install dimensional`),
 {{{#!hs
 {-# LANGUAGE TypeOperators, TypeFamilies #-}

 module Geodetics.Ellipsoids where

 import Numeric.Units.Dimensional
 import Numeric.Units.Dimensional.Prelude
 import Prelude ()  -- Numeric instances.


 -- | 3d vector as @(X,Y,Z)@.
 type Vec3 a = (a,a,a)

 -- | 3x3 transform matrix for Vec3.
 type Matrix3 a = Vec3 (Vec3 a)

 -- | Multiply a matrix by a vector in the Dimensional type system.
 transform3 :: (Num a) =>
    Matrix3 (Quantity d a) -> Vec3 (Quantity d' a) -> Vec3 (Quantity (d*d')
 a)
 transform3 (tx,ty,tz) v = (t tx v, t ty v, t tz v)
    where
       t (x1,y1,z1) (x2,y2,z2) = x1*x2 + y1*y2 + z1*z2

 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12212#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list