#6156: Optimiser bug on linux-powerpc
------------------------------------------+---------------------------------
  Reporter:  erikd                        |          Owner:  igloo  
      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):

 Pulling `succ` out of the `Enum` typeclass into a standalone program we
 get:

 {{{
 import GHC.Word
 import Numeric

 main :: IO ()
 main = putStrLn (showHex (succWord64 (0xa1a2a3a3ffffffff :: Word64)) "")

 succWord64 :: Word64 -> Word64
 succWord64 x =
     if x /= (0xffffffffffffffff::Word64)
         then x + 1
         else error "succWord64"
 }}}

 It still works correctly without optimisation and fails with it.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/6156#comment:33>
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