mkLiveness: when calculating the size of a parameter, round up not down.
authorSimon Marlow <simonmar@microsoft.com>
Fri, 3 Aug 2007 09:32:29 +0000 (09:32 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Fri, 3 Aug 2007 09:32:29 +0000 (09:32 +0000)
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.

compiler/cmm/CmmInfo.hs

index 3ee0da8..017efe4 100644 (file)
@@ -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