From eee55f955b219adb5877ff148a8ebeab908dffff Mon Sep 17 00:00:00 2001 From: sandeep Date: Fri, 9 Nov 2001 21:41:56 +0000 Subject: [PATCH] moved back NULLING of spil location. generated horrble code 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 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/SDCClrange.c b/src/SDCClrange.c index 9207338a..495d6807 100644 --- a/src/SDCClrange.c +++ b/src/SDCClrange.c @@ -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 } } } -- 2.47.2