summaryrefslogtreecommitdiff
path: root/compiler/cmm/CmmInfo.hs
diff options
context:
space:
mode:
authorSimon Marlow <simonmar@microsoft.com>2007-08-03 09:32:29 +0000
committerSimon Marlow <simonmar@microsoft.com>2007-08-03 09:32:29 +0000
commit7305dd722118cabc6feb3fca74bcac64236b1513 (patch)
treecb3118dbc791862239aaa41a2256095193fcb503 /compiler/cmm/CmmInfo.hs
parentbb6a7d1a735618d7f71e503c14d50d591277c083 (diff)
downloadhaskell-7305dd722118cabc6feb3fca74bcac64236b1513.tar.gz
mkLiveness: when calculating the size of a parameter, round up not down.
Fixes read002 on x86_64 (and maybe others). The stg_ap_f_info info table had the wrong liveness on it, because the float had been treated as having zero size.
Diffstat (limited to 'compiler/cmm/CmmInfo.hs')
-rw-r--r--compiler/cmm/CmmInfo.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/cmm/CmmInfo.hs b/compiler/cmm/CmmInfo.hs
index 3ee0da8205..017efe47f5 100644
--- a/compiler/cmm/CmmInfo.hs
+++ b/compiler/cmm/CmmInfo.hs
@@ -214,7 +214,9 @@ mkLiveness uniq live =
mkBits (reg:regs) = take sizeW bits ++ mkBits regs where
sizeW = case reg of
Nothing -> 1
- Just r -> machRepByteWidth (localRegRep r) `quot` wORD_SIZE
+ Just r -> (machRepByteWidth (localRegRep r) + wORD_SIZE - 1)
+ `quot` wORD_SIZE
+ -- number of words, rounded up
bits = repeat $ is_non_ptr reg -- True <=> Non Ptr
is_non_ptr Nothing = True