Improve error message (part of Trac #1606)
[ghc-hetmet.git] / compiler / cmm / CmmInfo.hs
index 78ff5af..017efe4 100644 (file)
@@ -165,8 +165,8 @@ mkInfoTableAndCode info_lbl std_info extra_bits entry_lbl args blocks
 
   | otherwise  -- Separately emit info table (with the function entry 
   =            -- point as first entry) and the entry code 
-    [mkDataLits info_lbl (CmmLabel entry_lbl : std_info ++ extra_bits),
-     CmmProc [] entry_lbl args blocks]
+    [CmmProc [] entry_lbl args blocks,
+     mkDataLits info_lbl (CmmLabel entry_lbl : std_info ++ extra_bits)]
 
 mkSRTLit :: CLabel
          -> C_SRT
@@ -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