Fixes for the unreg build
[ghc-hetmet.git] / compiler / cmm / CmmProcPoint.hs
index 36c02ff..df408c6 100644 (file)
@@ -79,8 +79,12 @@ calculateNewProcPoints  owners block =
           where
             parent_owners = lookupWithDefaultUFM owners emptyUniqSet parent_id
             child_owners = lookupWithDefaultUFM owners emptyUniqSet child_id
-            needs_proc_point = not $ isEmptyUniqSet $
-                               child_owners `minusUniqSet` parent_owners
+            needs_proc_point =
+                -- only if parent isn't dead
+                (not $ isEmptyUniqSet parent_owners) &&
+                -- and only if child has more owners than parent
+                (not $ isEmptyUniqSet $
+                     child_owners `minusUniqSet` parent_owners)
 
 calculateOwnership :: BlockEnv BrokenBlock
                    -> UniqSet BlockId
@@ -113,4 +117,4 @@ calculateOwnership blocks_ufm proc_points blocks =
                   new = old `unionUniqSets`
                         lookupWithDefaultUFM owners emptyUniqSet cause'
 
-      unknown_block = panic "unknown BlockId in selectStackFormat"
+      unknown_block = panic "unknown BlockId in calculateOwnership"