[GHC] #7574: Register allocator chokes on certain branches with literals

GHC cvs-ghc at haskell.org
Sun Jan 13 11:25:47 CET 2013


#7574: Register allocator chokes on certain branches with literals
-----------------------------+----------------------------------------------
Reporter:  thoughtpolice     |          Owner:                  
    Type:  bug               |         Status:  new             
Priority:  normal            |      Component:  Compiler        
 Version:  7.6.1             |       Keywords:                  
      Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
 Failure:  None/Unknown      |      Blockedby:                  
Blocking:                    |        Related:  7571, 7573      
-----------------------------+----------------------------------------------
 While running the test for #7571 (test is in #7573,) under
 '''WAY=normal''' instead of '''WAY=llvm''', I encountered this bug in the
 native backend:

 {{{

 =====> T7571(normal) 6 of 6 [0, 0, 0]
 cd . && '/Users/a/code/haskell/ghc/inplace/bin/ghc-stage2' -fforce-recomp
 -dcore-lint -dcmm-lint -dno-debug-output -no-user-package-db -rtsopts
 -fno-ghci-history -c T7571.cmm   -no-hs-main   >T7571.comp.stderr 2>&1
 Compile failed (status 256) errors were:
 ghc-stage2: panic! (the 'impossible' happened)
   (GHC version 7.7.20130113 for x86_64-apple-darwin):
         allocateRegsAndSpill: Cannot read from uninitialized register
     %vI_c7

 }}}

 The test in question is:

 {{{

 #include "Cmm.h"

 testLiteralBranch (W_ dst, W_ src)
 {
   if (1) {
     prim %memcpy(dst, src, 1024, 4);
   } else {
     prim %memcpy(dst, src, 512, 8);
   }
   return ();
 }

 }}}

 If you comment out the branch conditionals, the test passes, so clearly
 something fishy is going on here. The test also fails if you change the
 condition to ```if (1 == 1)```

 I have absolutely no idea how this did not trip the profiling-based build
 in StgStdThunks.cmm, like in the LLVM build c.f. #7571

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7574>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the ghc-tickets mailing list