From: johanknol Date: Sat, 15 Sep 2001 12:23:00 +0000 (+0000) Subject: fixed bug #460662 part 1 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=f4f1a71f88007efb2d6a81489bc9c0d763b1b207;p=fw%2Fsdcc fixed bug #460662 part 1 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1270 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/ds390/ralloc.c b/src/ds390/ralloc.c index 6eef25f4..8e40b3c1 100644 --- a/src/ds390/ralloc.c +++ b/src/ds390/ralloc.c @@ -1745,9 +1745,9 @@ findAssignToSym (operand * op, iCode * ic) /* or in stack space in case of + & - */ /* if assigned to a non-symbol then return - true */ + FALSE */ if (!IS_SYMOP (IC_RIGHT (dic))) - break; + return NULL; /* if the symbol is in far space then we should not */ diff --git a/src/mcs51/ralloc.c b/src/mcs51/ralloc.c index aaa47ce2..671f2945 100644 --- a/src/mcs51/ralloc.c +++ b/src/mcs51/ralloc.c @@ -1733,9 +1733,9 @@ findAssignToSym (operand * op, iCode * ic) /* or in stack space in case of + & - */ /* if assigned to a non-symbol then return - true */ + FALSE */ if (!IS_SYMOP (IC_RIGHT (dic))) - break; + return NULL; /* if the symbol is in far space then we should not */ @@ -1794,6 +1794,8 @@ static int packRegsForSupport (iCode * ic, eBBlock * ebp) { int change = 0; + iCode *dic, *sic; + /* for the left & right operand :- look to see if the left was assigned a true symbol in far space in that case replace them */ @@ -1801,8 +1803,7 @@ packRegsForSupport (iCode * ic, eBBlock * ebp) if (IS_ITEMP (IC_LEFT (ic)) && OP_SYMBOL (IC_LEFT (ic))->liveTo <= ic->seq) { - iCode *dic = findAssignToSym (IC_LEFT (ic), ic); - iCode *sic; + dic = findAssignToSym (IC_LEFT (ic), ic); if (!dic) goto right; @@ -1812,9 +1813,8 @@ packRegsForSupport (iCode * ic, eBBlock * ebp) for (sic = dic; sic != ic; sic = sic->next) bitVectUnSetBit (sic->rlive, IC_LEFT (ic)->key); - IC_LEFT (ic)->operand.symOperand = - IC_RIGHT (dic)->operand.symOperand; - IC_LEFT (ic)->key = IC_RIGHT (dic)->operand.symOperand->key; + OP_SYMBOL(IC_LEFT (ic))=OP_SYMBOL(IC_RIGHT (dic)); + IC_LEFT (ic)->key = OP_SYMBOL(IC_RIGHT (dic))->key; remiCodeFromeBBlock (ebp, dic); hTabDeleteItem (&iCodehTab, dic->key, dic, DELETE_ITEM, NULL); change++;