#6156: Optimiser bug on linux-powerpc
------------------------------------------+---------------------------------
  Reporter:  erikd                        |          Owner:  pcapriotti
      Type:  bug                          |         Status:  new       
  Priority:  normal                       |      Milestone:  7.6.1     
 Component:  Compiler                     |        Version:  7.4.1     
Resolution:                               |       Keywords:            
        Os:  Linux                        |   Architecture:  powerpc   
   Failure:  Incorrect result at runtime  |     Difficulty:  Unknown   
  Testcase:                               |      Blockedby:            
  Blocking:                               |        Related:            
------------------------------------------+---------------------------------

Comment(by erikd):

 Slightly simplified test case (may not be as complete as the original),
 but which should make debugging easier is:

 {{{
 {-# LANGUAGE MagicHash #-}
 import GHC.Base
 import GHC.Word
 import GHC.IntWord64
 import Numeric (showHex)

 input :: Word64
 input = 1238988323332265734

 result :: Word32
 result = case input of
         W64# x -> W32# (word64ToWord# x)

 main :: IO ()
 main = putStrLn $ "Result 0x" ++ showHex result ""
 }}}

 Compiling on PowerPC with `-O1` gives the correct result of `0xcd139706`
 and with `-O1 -fno-enable-rewrite-rule` gives an incorrect result of
 `0x9706`.

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

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to