Add {-# OPTIONS_GHC -w #-} and some blurb to all compiler modules
[ghc-hetmet.git] / compiler / cmm / CmmProcPoint.hs
index fe64608..f7af8ca 100644 (file)
@@ -1,3 +1,10 @@
+{-# OPTIONS_GHC -w #-}
+-- The above warning supression flag is a temporary kludge.
+-- While working on this module you are encouraged to remove it and fix
+-- any warnings in the module. See
+--     http://hackage.haskell.org/trac/ghc/wiki/WorkingConventions#Warnings
+-- for details
+
 module CmmProcPoint (
   calculateProcPoints
   ) where
@@ -79,8 +86,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