#9155 closed bug (fixed)

O2: allocateRegsAndSpill: Cannot read from uninitialized register %vI_s154O (GHC version 7.8.2 for x86_64-unknown-linux)

Reported by: slyfox Owned by: simonmar
Priority: highest Milestone: 7.8.3
Component: Compiler (NCG) Version: 7.8.2
Keywords: Cc: simonmar
Operating System: Unknown/Multiple Architecture: x86_64 (amd64)
Type of failure: Compile-time crash Test Case:
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description

When building all world with -O2 I've stuck on wxhaskell (all versions):

[11 of 16] Compiling Graphics.UI.WX.Controls ( src/Graphics/UI/WX/Controls.hs, dist/build/Graphics/UI/WX/Controls.o )

<no location info>:
    ghc: panic! (the 'impossible' happened)
  (GHC version 7.8.2 for x86_64-unknown-linux):
        allocateRegsAndSpill: Cannot read from uninitialized register
    %vI_s154O

I've stripped it down to minimal complete example (but it significantly changed error message)

ghc: panic! (the 'impossible' happened)
  (GHC version 7.8.2 for x86_64-unknown-linux):
        RegAlloc.Liveness.computeLivenss
    SCCs aren't in reverse dependent order
    bad blockId c1tU
    [NONREC
        c1uc:
                movq $-8,%rbx
                andq $main:M.AlignLeft{v rb}_closure+1,%rbx
                addq $8,%rbp
                jmp *(%rbx),
     NONREC
...

Attachments (1)

M.hs (659 bytes) - added by slyfox 12 months ago.
test case

Download all attachments as: .zip

Change History (11)

Changed 12 months ago by slyfox

test case

comment:1 Changed 12 months ago by slyfox

  • Summary changed from allocateRegsAndSpill: Cannot read from uninitialized register %vI_s154O (GHC version 7.8.2 for x86_64-unknown-linux) to O2: allocateRegsAndSpill: Cannot read from uninitialized register %vI_s154O (GHC version 7.8.2 for x86_64-unknown-linux)

Compile as:

ghc -c --make -hide-all-packages -package base -O2 M

comment:2 Changed 12 months ago by slyfox

-HEAD has the same disease:

[sf] ~/dev/git/ghc:inplace/bin/ghc-stage2 --make -O2 /tmp/M.hs 
[1 of 1] Compiling M                ( /tmp/M.hs, /tmp/M.o )
ghc-stage2: panic! (the 'impossible' happened)
  (GHC version 7.9.20140531 for x86_64-unknown-linux):
        RegAlloc.Liveness.computeLivenss
    SCCs aren't in reverse dependent order
    bad blockId c1cG
...

comment:3 Changed 12 months ago by slyfox

  • Architecture changed from Unknown/Multiple to x86_64 (amd64)
  • Cc simonmar added
  • Component changed from Compiler to Compiler (NCG)
  • Type of failure changed from None/Unknown to Compile-time crash

comment:4 Changed 12 months ago by niklasl

The issue disappears when I revert commit f5879acd018494b84233f26fba828ce376d0f81d

comment:5 Changed 12 months ago by simonmar

  • Milestone set to 7.8.3
  • Owner set to simonmar
  • Priority changed from normal to highest

Investigating.

comment:6 Changed 12 months ago by simonmar

I have a fix for this, indeed f5879acd018494b84233f26fba828ce376d0f81d was buggy. I'll do some more testing and measurement before I push. This is a blocker for 7.8.3.

comment:7 Changed 12 months ago by simonmar

Just to let you know I'm still working on this, hope to have it done today or tomorrow.

comment:8 Changed 12 months ago by Simon Marlow <marlowsd@…>

In e577a52363ee7ee8a07f1d863988332ae8fbf2e4/ghc:

Fix discarding of unreachable code in the register allocator (#9155)

A previous fix to this was wrong: f5879acd018494b84233f26fba828ce376d0f81d
and left some unreachable code behind.  So rather than try to be clever and
do this at the same time as the strongly-connected-component analysis, I'm
doing a separate reachability pass first.

comment:9 Changed 12 months ago by simonmar

  • Status changed from new to merge

comment:10 Changed 12 months ago by thoughtpolice

  • Resolution set to fixed
  • Status changed from merge to closed

Merged.

Note: See TracTickets for help on using tickets.