[GHC] #8184: Compiler panic in the presence of cyclic imports

GHC ghc-devs at haskell.org
Tue Aug 27 20:17:41 UTC 2013


#8184: Compiler panic in the presence of cyclic imports
-----------------------------------+---------------------------------------
       Reporter:  parcs            |             Owner:
           Type:  bug              |            Status:  new
       Priority:  normal           |         Milestone:
      Component:  Compiler         |           Version:  7.7
       Keywords:                   |  Operating System:  Unknown/Multiple
   Architecture:                   |   Type of failure:  Compile-time crash
  Unknown/Multiple                 |         Test Case:
     Difficulty:  Unknown          |          Blocking:  910
     Blocked By:                   |
Related Tickets:                   |
-----------------------------------+---------------------------------------
 A.hs
 {{{
 #!haskell
 module A where

 import {-# SOURCE #-} B

 data X = X Y
 }}}

 B.hs-boot
 {{{
 #!haskell
 module B where

 data Y
 }}}

 B.hs
 {{{
 #!haskell
 module B where

 import A

 data Y = Y Int Int

 thing :: X -> a
 thing (X (Y a b)) = thing (X (Y a b))
 }}}

 C.hs
 {{{
 #!haskell
 module C where

 import A
 import B

 panic :: Int -> a
 panic x = thing (X (Y x x))
 }}}

 Now try to compile module C:

 {{{
 $ ghc-stage2 -O C
 [1 of 4] Compiling B[boot]          ( B.hs-boot, B.o-boot )
 [2 of 4] Compiling A                ( A.hs, A.o )
 [3 of 4] Compiling B                ( B.hs, B.o )
 [4 of 4] Compiling C                ( C.hs, C.o )
 ghc-stage2: panic! (the 'impossible' happened)
   (GHC version 7.7.20130826 for x86_64-unknown-linux):
         applyTypeToArgs
     main:B.$wthing{v rsQ} [gid]
       @ a{tv ivX} [tv] ww_iwm{v} [lid] ww_iwn{v} [lid]
     a{tv ivX} [tv]

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

 }}}

 I encountered this bug when attempting to compile GHC with GHC -O2 --make.

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




More information about the ghc-tickets mailing list