Opened 16 months ago

Closed 8 months ago

#7534 closed bug (duplicate)

allocateRegsAndSpill: Cannot read from uninitialized register

Reported by: erikd Owned by:
Priority: high Milestone: 7.8.1
Component: Compiler Version: 7.7
Keywords: Cc: pho@…
Operating System: Linux Architecture: powerpc64
Type of failure: Building GHC failed Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Building git HEAD on linux-powerpc64 and I get:

ghc-stage1: panic! (the 'impossible' happened)
  (GHC version 7.7.20121227 for powerpc-unknown-linux):
        allocateRegsAndSpill: Cannot read from uninitialized register
    %vI_na5b

Change History (12)

comment:1 Changed 16 months ago by erikd

From compiler/nativeGen/RegAlloc/Linear/Main.hs:

    -- 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.

comment:2 Changed 16 months ago by PHO

  • Cc pho@… added

comment:3 Changed 16 months ago by simonpj

  • Difficulty set to Unknown
  • Owner set to simonmar

Simon M, could this be anything to do with the new codegen path? I'll asssign it to you for now.

Simon

comment:4 Changed 16 months ago by simonmar

So the background is that this panic used to be commented out, but I enabled it recently because it makes debugging much easier (with the panic commented out, the compiler will happily generate completely bogus code that will crash at runtime). However, it adds another invariant, as mentioned in the comment: all register must be written before they are read (not an unreasonable assumption, I'm sure you'll agree) I presume this invariant is being violated somewhere.

To debug it you'll need to use -ddump-cmm and find out where the bogus code comes from.

comment:5 Changed 15 months ago by simonmar

  • Status changed from new to infoneeded

More info needed to make progress on this one, the repro case only happens on PPC/Linux.

comment:6 Changed 15 months ago by PHO

Isn't this related to #7442?

comment:7 follow-up: Changed 15 months ago by simonmar

I don't immediately see the connection to #7442?

comment:8 in reply to: ↑ 7 Changed 15 months ago by PHO

Replying to simonmar:

I don't immediately see the connection to #7442?

Just a thought. Even though PPC/Linux doesn't have the problem described in the note [inconsistent-pic-reg], PIC.initialisePicBase_ppc still semms to be assuming only the first block is an entry point.

comment:9 Changed 15 months ago by erikd

  • Status changed from infoneeded to new

I added -ddump-cmm to the command line of the compile that was failing and saved the output to a file. Unfortunately there is no sign on the uninitialized register %vI_na5b in the dumped file.

comment:10 Changed 15 months ago by simonmar

  • Owner simonmar deleted

This could be the same as #7574, I described the fix that was needed on that ticket and @thoughtpolice said he would look into it.

comment:11 Changed 12 months ago by igloo

  • Milestone set to 7.8.1
  • Priority changed from normal to high

comment:12 Changed 8 months ago by thoughtpolice

  • Resolution set to duplicate
  • Status changed from new to closed

This looks like an exact duplicate of #7574, and I've been working on it the past day, so I'll close this.

Note: See TracTickets for help on using tickets.