]> git.gag.com Git - fw/sdcc/commitdiff
moved back NULLING of spil location. generated horrble code
authorsandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 9 Nov 2001 21:41:56 +0000 (21:41 +0000)
committersandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 9 Nov 2001 21:41:56 +0000 (21:41 +0000)
have to check some more

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1547 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCClrange.c

index 9207338affba3d2cc6a3a54d087461471bf41472..495d68072ec2435b97d4aed0681778d042c79f40 100644 (file)
@@ -568,6 +568,16 @@ rlivePoint (eBBlock ** ebbs, int count)
                    ic->rlive = bitVectSetBit (ic->rlive, lrange->key);
                }
            }
+           /* overlapping live ranges should be eliminated */
+           if (ASSIGN_ITEMP_TO_ITEMP (ic)) {
+               if (SPIL_LOC(IC_RIGHT(ic)) == SPIL_LOC(IC_RESULT(ic))   && /* left & right share the same spil location */
+                   OP_SYMBOL(IC_RESULT(ic))->isreqv                    && /* left of assign is a register requivalent */
+                   !OP_SYMBOL(IC_RIGHT(ic))->isreqv                    && /* right side is not */
+                   OP_SYMBOL(IC_RIGHT(ic))->liveTo > ic->key           && /* right side live beyond this point */
+                   bitVectnBitsOn(OP_DEFS(IC_RESULT(ic))) > 1 )        {  /* left has multiple definitions */
+                   SPIL_LOC(IC_RIGHT(ic)) = NULL; /* then cannot share */
+               }
+           }
        }
     }
 }
@@ -614,7 +624,7 @@ static void computeClash ()
            /* so they overlap : set both their clashes */
            inner->clashes = bitVectSetBit(inner->clashes,outer->key);
            outer->clashes = bitVectSetBit(outer->clashes,inner->key);
-           
+#if 0      
            /* check if they share the same spillocation */
            if (SYM_SPIL_LOC(inner) && SYM_SPIL_LOC(outer)) {
                if (inner->reqv && !outer->reqv) SYM_SPIL_LOC(outer)=NULL;
@@ -622,6 +632,7 @@ static void computeClash ()
                else if (inner->used > outer->used) SYM_SPIL_LOC(outer)=NULL;
                else SYM_SPIL_LOC(inner)=NULL;
            }
+#endif
        }
     }
 }