]> git.gag.com Git - fw/sdcc/commitdiff
fixed bug #460662 part 1
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 15 Sep 2001 12:23:00 +0000 (12:23 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 15 Sep 2001 12:23:00 +0000 (12:23 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1270 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/ds390/ralloc.c
src/mcs51/ralloc.c

index 6eef25f44df37c4f3f59907634b597c0be1b21a9..8e40b3c1e152890020f9568c25c976177173573a 100644 (file)
@@ -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 */
index aaa47ce21bdd617cc95e56ee02f1f7645ca2c96c..671f29452763317637a562e95956273281b427d0 100644 (file)
@@ -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++;