[GHC] #7814: panic in PPC NCG

GHC cvs-ghc at haskell.org
Sat Apr 13 17:19:10 CEST 2013


#7814: panic in PPC NCG
--------------------------+-------------------------------------------------
    Reporter:  heisenbug  |       Owner:  heisenbug          
        Type:  bug        |      Status:  new                
    Priority:  normal     |   Milestone:                     
   Component:  Compiler   |     Version:  7.7                
    Keywords:             |          Os:  Unknown/Multiple   
Architecture:  powerpc    |     Failure:  Building GHC failed
  Difficulty:  Unknown    |    Testcase:                     
   Blockedby:             |    Blocking:                     
     Related:             |  
--------------------------+-------------------------------------------------
Changes (by igloo):

  * difficulty:  => Unknown


Old description:

> I get panics in the NCG PPC register allocator while compiling these
> files:
>
>   rts_dist_HC rts/dist/build/StgStdThunks.dyn_o
>   rts_dist_HC rts/dist/build/StgStdThunks.thr_dyn_o
>   rts_dist_HC rts/dist/build/StgStdThunks.l_dyn_o
>   rts_dist_HC rts/dist/build/StgStdThunks.thr_l_dyn_o
>   HC [stage 1] libraries/ghc-prim/dist-install/build/GHC/Classes.o
>   HC [stage 1] libraries/ghc-prim/dist-install/build/GHC/CString.o
>   HC [stage 1] libraries/ghc-prim/dist-install/build/GHC/Debug.o
>
> The panic message is like this:
> {{{
> ghc-stage1: panic! (the 'impossible' happened)
>   (GHC version 7.7.20130405 for powerpc-montavista-linux):
>         allocateRegsAndSpill: Cannot read from uninitialized register
>     %vI_nff
>
> }}}
>
> This makes the bootstapping of PPC cross compiler, ehm, delicate.
>
> There is a comment in compiler/nativeGen/RegAlloc/Linear/Main.hs:756
>
>                 Nothing | reading   ->
>                    pprPanic "allocateRegsAndSpill: Cannot read from
> uninitialized register" (ppr r)
>                    -- NOTE: if the input to the NCG contains some
>                    -- unreachable blocks with junk code, this panic
>                    -- might be triggered.  Make sure you only feed
>                    -- sensible code into the NCG.  In CmmPipeline we
>                    -- call removeUnreachableBlocks at the end for this
>                    -- reason.
>
> So we have a 'junk code' issue here.
>
> Any hints how I can debug this?

New description:

 I get panics in the NCG PPC register allocator while compiling these
 files:
 {{{
   rts_dist_HC rts/dist/build/StgStdThunks.dyn_o
   rts_dist_HC rts/dist/build/StgStdThunks.thr_dyn_o
   rts_dist_HC rts/dist/build/StgStdThunks.l_dyn_o
   rts_dist_HC rts/dist/build/StgStdThunks.thr_l_dyn_o
   HC [stage 1] libraries/ghc-prim/dist-install/build/GHC/Classes.o
   HC [stage 1] libraries/ghc-prim/dist-install/build/GHC/CString.o
   HC [stage 1] libraries/ghc-prim/dist-install/build/GHC/Debug.o
 }}}
 The panic message is like this:
 {{{
 ghc-stage1: panic! (the 'impossible' happened)
   (GHC version 7.7.20130405 for powerpc-montavista-linux):
         allocateRegsAndSpill: Cannot read from uninitialized register
     %vI_nff

 }}}

 This makes the bootstapping of PPC cross compiler, ehm, delicate.

 There is a comment in compiler/nativeGen/RegAlloc/Linear/Main.hs:756
 {{{
                 Nothing | reading   ->
                    pprPanic "allocateRegsAndSpill: Cannot read from
 uninitialized register" (ppr r)
                    -- NOTE: if the input to the NCG contains some
                    -- unreachable blocks with junk code, this panic
                    -- might be triggered.  Make sure you only feed
                    -- sensible code into the NCG.  In CmmPipeline we
                    -- call removeUnreachableBlocks at the end for this
                    -- reason.
 }}}
 So we have a 'junk code' issue here.

 Any hints how I can debug this?

--

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



More information about the ghc-tickets mailing list