Ticket #6156: 0001-Fix-for-optimizer-bug-on-linux-powerpc-6156.patch

File 0001-Fix-for-optimizer-bug-on-linux-powerpc-6156.patch, 1.4 KB (added by erikd, 20 months ago)

Patch to fix this.

  • compiler/nativeGen/PPC/CodeGen.hs

    From 57d7e3a29baaacc55bc19bfe03b5ea7a25069281 Mon Sep 17 00:00:00 2001
    From: Erik de Castro Lopo <erikd@mega-nerd.com>
    Date: Thu, 23 Aug 2012 20:39:47 +1000
    Subject: [PATCH] Fix for optimizer bug on linux-powerpc (#6156).
    
    ---
     compiler/nativeGen/PPC/CodeGen.hs |    8 ++++----
     1 file changed, 4 insertions(+), 4 deletions(-)
    
    diff --git a/compiler/nativeGen/PPC/CodeGen.hs b/compiler/nativeGen/PPC/CodeGen.hs
    index 4090d95..b6c83ee 100644
    a b iselExpr64 (CmmLit (CmmInt i _)) = do 
    320320  (rlo,rhi) <- getNewRegPairNat II32 
    321321  let 
    322322        half0 = fromIntegral (fromIntegral i :: Word16) 
    323         half1 = fromIntegral ((fromIntegral i `shiftR` 16) :: Word16) 
    324         half2 = fromIntegral ((fromIntegral i `shiftR` 32) :: Word16) 
    325         half3 = fromIntegral ((fromIntegral i `shiftR` 48) :: Word16) 
     323        half1 = fromIntegral (fromIntegral (i `shiftR` 16) :: Word16) 
     324        half2 = fromIntegral (fromIntegral (i `shiftR` 32) :: Word16) 
     325        half3 = fromIntegral (fromIntegral (i `shiftR` 48) :: Word16) 
    326326 
    327327        code = toOL [ 
    328328                LIS rlo (ImmInt half1), 
    329329                OR rlo rlo (RIImm $ ImmInt half0), 
    330330                LIS rhi (ImmInt half3), 
    331                 OR rlo rlo (RIImm $ ImmInt half2) 
     331                OR rhi rhi (RIImm $ ImmInt half2) 
    332332                ] 
    333333  return (ChildCode64 code rlo) 
    334334