[GHC] #9303: O2: (GHC version 7.8.3 for x86_64-unknown-linux): allocateRegsAndSpill: Cannot read from uninitialized register %vI_s1Mp

GHC ghc-devs at haskell.org
Fri Jul 18 15:45:47 UTC 2014


#9303: O2: (GHC version 7.8.3 for x86_64-unknown-linux): allocateRegsAndSpill:
Cannot read from uninitialized register %vI_s1Mp
-------------------------------------+-------------------------------------
              Reporter:  slyfox      |             Owner:  simonmar
                  Type:  bug         |            Status:  new
              Priority:  highest     |         Milestone:  7.8.4
             Component:  Compiler    |           Version:  7.8.3
  (NCG)                              |          Keywords:
            Resolution:              |  Operating System:  Unknown/Multiple
Differential Revisions:              |   Type of failure:  Compile-time
          Architecture:  x86_64      |  crash
  (amd64)                            |         Test Case:
            Difficulty:  Unknown     |          Blocking:
            Blocked By:              |
       Related Tickets:              |
-------------------------------------+-------------------------------------

Comment (by slyfox):

 Managed to squeeze M-mini into even shorter example:
 {{{
 -- a.hs
 module M (f) where

 f :: Int -> Int
 f i = go [ 1, 0 ]
     where
       go :: [Int] -> Int
       go []     = undefined
       go [1]    = undefined
       go (x:xs) | x == i    = 2
                 | otherwise = go xs
 }}}

 profiled -HEAD can even show stack trace:
 {{{
 [sf] /tmp:~/dev/git/ghc/inplace/bin/ghc-stage2 --make -O2 a.hs
 [1 of 1] Compiling M                ( a.hs, a.o )
 ghc-stage2: panic! (the 'impossible' happened)
   (GHC version 7.9.20140712 for x86_64-unknown-linux):
         allocateRegsAndSpill: Cannot read from uninitialized register
     %vI_sNc
 Stack trace:
   AsmCodeGen.RegAlloc
 (compiler/nativeGen/AsmCodeGen.lhs:(521,27)-(523,55))
   AsmCodeGen.cmmNativeGen (compiler/nativeGen/AsmCodeGen.lhs:379:47-95)
   CodeOutput.NativeCodeGen (compiler/main/CodeOutput.lhs:153:18-69)
   CodeOutput.OutputAsm (compiler/main/CodeOutput.lhs:(151,37)-(153,69))
   HscMain.codeOutput (compiler/main/HscMain.hs:(1180,16)-(1181,50))
   GhcMake.upsweep_mod.compile_it
 (compiler/main/GhcMake.hs:(1186,13)-(1188,66))
   GhcMake.upsweep_mod (compiler/main/GhcMake.hs:(1135,1)-(1280,49))
   GhcMake.upsweep.upsweep' (compiler/main/GhcMake.hs:(1068,3)-(1124,64))
   GhcMake.upsweep (compiler/main/GhcMake.hs:(1063,1)-(1124,64))
   GhcMake.load (compiler/main/GhcMake.hs:(150,1)-(369,38))
   GHC.defaultCleanupHandler (compiler/main/GHC.hs:(384,1)-(390,11))
   GHC.runGhc (compiler/main/GHC.hs:(414,1)-(419,7))

 Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
 }}}

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


More information about the ghc-tickets mailing list