fixed a register allocation bug
authorsandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 24 Jun 2000 23:40:31 +0000 (23:40 +0000)
committersandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 24 Jun 2000 23:40:31 +0000 (23:40 +0000)
caused same registers to be allocated
in reverse order for an asignment

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

src/mcs51/ralloc.c
src/z80/ralloc.c

index 80d81667596cc4a31c44ffd53864fac490832f2b..368f58fa7ae72682b7ca981b9a5f0cecc514cf0d 100644 (file)
@@ -1103,7 +1103,7 @@ static void serialRegAssign (eBBlock **ebbs, int count)
                                     OP_SYMBOL(IC_LEFT(ic)),ic->lineno);
                /* do the same for the right operand */
                if (IC_RIGHT(ic) && IS_SYMOP(IC_RIGHT(ic)) &&
-                   OP_SYMBOL(IC_RIGHT(ic))->nRegs && ic->op != '=')
+                   OP_SYMBOL(IC_RIGHT(ic))->nRegs)
                        positionRegs(OP_SYMBOL(IC_RESULT(ic)),
                                     OP_SYMBOL(IC_RIGHT(ic)),ic->lineno);
                
index 24628a586a64fd5de12396efc2e698605329b12b..db0153b14e40891ed1e629f04c537d8181f194c2 100644 (file)
@@ -1048,7 +1048,7 @@ static void serialRegAssign (eBBlock **ebbs, int count)
                                     OP_SYMBOL(IC_LEFT(ic)),ic->lineno);
                /* do the same for the right operand */
                if (IC_RIGHT(ic) && IS_SYMOP(IC_RIGHT(ic)) &&
-                   OP_SYMBOL(IC_RIGHT(ic))->nRegs && ic->op != '=')
+                   OP_SYMBOL(IC_RIGHT(ic))->nRegs)
                        positionRegs(OP_SYMBOL(IC_RESULT(ic)),
                                     OP_SYMBOL(IC_RIGHT(ic)),ic->lineno);