Better fix for bug # 514308
authorsandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 2 Mar 2002 18:42:16 +0000 (18:42 +0000)
committersandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 2 Mar 2002 18:42:16 +0000 (18:42 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1977 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCcse.c

index 6141c05bfb2e8c8a98342158e5d2e752696fe32c..a5ea44f393830ed470c338d37be4d7b054051f5a 100644 (file)
@@ -1539,6 +1539,10 @@ cseBBlock (eBBlock * ebb, int computeOnly,
                {
                  if (IS_ITEMP (pdop) || IS_OP_LITERAL (pdop))
                    {
+                       /* some non dominating block does POINTER_SET with
+                          this variable .. unsafe to remove any POINTER_GETs */
+                       if (bitVectBitValue(ebb->ndompset,IC_LEFT(ic)->key))
+                           ebb->ptrsSet = bitVectSetBit(ebb->ptrsSet,pdop->key);
                      IC_LEFT (ic) = pdop;
                      change = 1;
                    }
@@ -1617,7 +1621,7 @@ cseBBlock (eBBlock * ebb, int computeOnly,
 
       /* Alternate code */
       if (pdic && IS_ITEMP(IC_RESULT(ic))) {
-       if (POINTER_GET(ic) && (pdic->level < ic->level)) {
+       if (POINTER_GET(ic) && bitVectBitValue(ebb->ptrsSet,IC_LEFT(ic)->key)) {
          /* Mmm, found an equivalent pointer get at a lower level. 
             This could be a loop however with the same pointer set 
             later on */