Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,249
    • Issues 5,249
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 581
    • Merge requests 581
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #7814
Closed
Open
Issue created Apr 05, 2013 by Gabor Greif@ggreif💬Developer

panic in PPC NCG

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?

Edited Mar 09, 2019 by Ian Lynagh <igloo@earth.li>
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking