Opened 10 months ago

Closed 4 months ago

#9031 closed bug (worksforme)

ghc panic: RegAlloc.Liveness.computeLivenss

Reported by: jwlato Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.8.2
Keywords: Cc: sonkoly.pal@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time crash Test Case:
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description

I have some code where ghc consistently panics with

  RegAlloc.Liveness.computeLivenss
    SCCs aren't in reverse dependent order
    bad blockId c1kek

The only reference I can find to that block in the dumped output is here:

     REC
        c1kej:
              movq $block{v c1keo}_info,(%rbp)
              movsd 7(%rbx),%vSSE_s1ivM
              movsd 15(%rbx),%vSSE_s1ivN
              movq 96(%rbp),%rbx
              movsd %vSSE_s1ivN,88(%rbp)
              movsd %vSSE_s1ivM,96(%rbp)
              testq $7,%rbx
              jne _c1keo
              jmp _c1kep
        c1kpo:
              movq $block{v c1kej}_info,(%rbp)
              movq %vI_s1it5,%rbx
              movq $0,120(%rbp)
              testq $7,%rbx
              jne _c1kej
              jmp _c1kek,

There doesn't appear to be any reference to c1kpo either.

Unfortunately I don't yet have a test case I can provide; I'll keep working on that. Building with -dcore-lint and -dcmm-lint don't show any extra errors.

This is with ghc-7.8.2 using NCG.

Attachments (2)

BB.hs (587 bytes) - added by jwlato 10 months ago.
Top.hs (710 bytes) - added by jwlato 10 months ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 10 months ago by phaul

Hi, I think I am hitting the same issue after upgrading from 7.6.3 to 7.8.2. Previously the same code was building fine. I have my code on github. https://github.com/phaul/chess/tree/ghc-7.8.2.
(You need the ghc-7.8.2 branch)

The problematic module is Chess.Move.Generator.

I get:

[18 of 30] Compiling Chess.Move.Generator ( Chess/Move/Generator.hs, dist/build/chess/chess-tmp/Chess/Move/Generator.o )
ghc: panic! (the 'impossible' happened)
  (GHC version 7.8.2 for i386-unknown-linux):
	RegAlloc.Liveness.computeLivenss
    SCCs aren't in reverse dependent order
    bad blockId c1AEd
    [NONREC
        c1AEI:

Can you try to use my code to reproduce the issue?

Thanks

Paul.

comment:2 Changed 10 months ago by phaul

My code from above builds fine after changing -O2 to -O0 in the cabal file.

comment:3 Changed 10 months ago by phaul

  • Cc sonkoly.pal@… added

comment:4 Changed 10 months ago by jwlato

Paul, thanks very much. I've created a self-contained test case based on your code (I believe it's the same issue I'm having). When I try to compile the attached files with

ghc -O2 Top.hs

I get the same error.

One interesting thing is that this error seems to require that pawnAdvanceSquares is called in multiple locations, even though in the generated core it only appears once.

Changed 10 months ago by jwlato

Changed 10 months ago by jwlato

comment:5 Changed 4 months ago by jwlato

I can no longer reproduce this with ghc-7.8.3, so I think this can be closed now.

comment:6 Changed 4 months ago by thomie

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

Closing by original reporter's suggestion.

Note: See TracTickets for help on using tickets.