summaryrefslogtreecommitdiff
path: root/compiler/nativeGen
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2011-07-19 15:30:15 +0100
committerSimon Marlow <marlowsd@gmail.com>2011-07-20 09:17:14 +0100
commitd58d46278ddbf9470072bc315a0b58a01726eed9 (patch)
tree05d3853149c0b410fda431486a147e196b581dfa /compiler/nativeGen
parent972351069cff21a589d80b93c7ce09713afa863b (diff)
downloadhaskell-d58d46278ddbf9470072bc315a0b58a01726eed9.tar.gz
Fix a bug in the code generation for 64-bit literals on 32-bit x86: we
were accidentally zeroing out the high 32 bits. This bug must have been here for ages, it was only just exposed by the new Typeable code which uses two 64-bit values to store a 128-bit hash, and so exercises the code generation for 64-bit stuff.
Diffstat (limited to 'compiler/nativeGen')
-rw-r--r--compiler/nativeGen/X86/CodeGen.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/nativeGen/X86/CodeGen.hs b/compiler/nativeGen/X86/CodeGen.hs
index 268bc7534e..75d821bb08 100644
--- a/compiler/nativeGen/X86/CodeGen.hs
+++ b/compiler/nativeGen/X86/CodeGen.hs
@@ -323,7 +323,7 @@ iselExpr64 (CmmLit (CmmInt i _)) = do
(rlo,rhi) <- getNewRegPairNat II32
let
r = fromIntegral (fromIntegral i :: Word32)
- q = fromIntegral ((fromIntegral i `shiftR` 32) :: Word32)
+ q = fromIntegral (fromIntegral (i `shiftR` 32) :: Word32)
code = toOL [
MOV II32 (OpImm (ImmInteger r)) (OpReg rlo),
MOV II32 (OpImm (ImmInteger q)) (OpReg rhi)