* src/SDCCcse.c (cseBBlock): fixed bug #527779
[fw/sdcc] / src / SDCCdflow.c
index 3b3f8dd1438428bd3ac86d6fb5604938f4356be4..ab44c7522aa99682421847b715d99288a774a08b 100644 (file)
@@ -117,6 +117,15 @@ DEFSETFUNC (mergeInExprs)
     }
   else
     {
+      cseDef *expr;
+      
+      /* cseBBlock does a much more thorough analysis than   */
+      /* ifKilledInBlock. Anything that is listed in inExprs */
+      /* but not in outExprs must have been killed somehow.  */
+      for (expr=setFirstItem(ebp->inExprs); expr; expr=setNextItem(ebp->inExprs))
+        if (!isinSet(ebp->outExprs, expr))
+          deleteSetItem (&dest->inExprs, expr);
+          
       /* delete only if killed in this block */
       deleteItemIf (&dest->inExprs, ifKilledInBlock, ebp);
       /* union the ndompset with pointers set in this block */