]> git.gag.com Git - fw/sdcc/commitdiff
final fix for bug 444507
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 30 Jul 2001 12:03:15 +0000 (12:03 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 30 Jul 2001 12:03:15 +0000 (12:03 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1110 4a8a32a2-be11-0410-ad9d-d568d2c75423

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

index 333e688c4430dd05fe126cea61582a2d7508df28..0481331e46e0c9bf23d2e63970a57c600024d807 100644 (file)
@@ -5353,9 +5353,15 @@ genAnd (iCode * ic, iCode * ifx)
                emitcode ("anl", "a,%s",
                          aopGet (AOP (right), offset, FALSE, FALSE, FALSE));
              } else {
-               MOVA (aopGet (AOP (right), offset, FALSE, FALSE, TRUE));
-               emitcode ("anl", "a,%s",
-                         aopGet (AOP (left), offset, FALSE, FALSE, FALSE));
+               if (AOP_TYPE(left)==AOP_ACC) {
+                 emitcode("mov", "b,a");
+                 MOVA (aopGet (AOP (right), offset, FALSE, FALSE, TRUE));
+                 emitcode("anl", "a,b");
+               }else {
+                 MOVA (aopGet (AOP (right), offset, FALSE, FALSE, TRUE));
+                 emitcode ("anl", "a,%s",
+                           aopGet (AOP (left), offset, FALSE, FALSE, FALSE));
+               }
              }
              emitcode ("jnz", "%05d$", tlbl->key + 100);
              offset++;
index 2ff9574eaee311ea60c4446c7d9fb17caf86ad49..a9a66ceac515e548dd779d637674e6f73ee0d139 100644 (file)
@@ -1619,24 +1619,12 @@ packRegsForAssign (iCode * ic, eBBlock * ebp)
      we cannot */
   for (dic = ic->prev; dic; dic = dic->prev)
     {
-#if 0 // jwk 20010410, the JanVanBelle case
-      /* if there is a function call and this is
-         a parameter & not my parameter then don't pack it */
-      if ((dic->op == CALL || dic->op == PCALL) &&
-         (OP_SYMBOL (IC_RESULT (ic))->_isparm &&
-          !OP_SYMBOL (IC_RESULT (ic))->ismyparm))
-       {
-         dic = NULL;
-         break;
-       }
-#else
       /* if there is a function call then don't pack it */
       if ((dic->op == CALL || dic->op == PCALL))
        {
          dic = NULL;
          break;
        }
-#endif
 
       if (SKIP_IC2 (dic))
        continue;
index 90cb2c0de7658fcbe9fd4f5ae83b22de9c12a354..2e64ad217e74c22bcd17e242335d0037e832bef2 100644 (file)
@@ -4596,9 +4596,15 @@ genAnd (iCode * ic, iCode * ifx)
                emitcode ("anl", "a,%s",
                          aopGet (AOP (right), offset, FALSE, FALSE));
              } else {
-               MOVA (aopGet (AOP (right), offset, FALSE, FALSE));
-               emitcode ("anl", "a,%s",
-                         aopGet (AOP (left), offset, FALSE, FALSE));
+               if (AOP_TYPE(left)==AOP_ACC) {
+                 emitcode("mov", "b,a");
+                 MOVA (aopGet (AOP (right), offset, FALSE, FALSE));
+                 emitcode("anl", "a,b");
+               }else {
+                 MOVA (aopGet (AOP (right), offset, FALSE, FALSE));
+                 emitcode ("anl", "a,%s",
+                           aopGet (AOP (left), offset, FALSE, FALSE));
+               }
              }
              emitcode ("jnz", "%05d$", tlbl->key + 100);
              offset++;
index f1a4e1dda17a05653368a6bf8f56333650f73025..aa49eebf0cd0419623609992051f16a041231eec 100644 (file)
@@ -1583,7 +1583,7 @@ static int
 packRegsForAssign (iCode * ic, eBBlock * ebp)
 {
   iCode *dic, *sic;
-  sym_link *etype = operandType (IC_RIGHT (ic));
+  //sym_link *etype = operandType (IC_RIGHT (ic));
 
   if (!IS_ITEMP (IC_RIGHT (ic)) ||
       OP_SYMBOL (IC_RIGHT (ic))->isind ||
@@ -1595,43 +1595,21 @@ packRegsForAssign (iCode * ic, eBBlock * ebp)
 
   /* if the true symbol is defined in far space or on stack
      then we should not since this will increase register pressure */
-#if 0
-  if (isOperandInFarSpace (IC_RESULT (ic)))
-    {
-      if ((dic = farSpacePackable (ic)))
-       goto pack;
-      else
-       return 0;
-    }
-#else
   if (isOperandInFarSpace(IC_RESULT(ic)) && !farSpacePackable(ic)) {
     return 0;
   }
-#endif
 
   /* find the definition of iTempNN scanning backwards if we find a 
      a use of the true symbol in before we find the definition then 
      we cannot */
   for (dic = ic->prev; dic; dic = dic->prev)
     {
-#if 0 // jwk 20010410
-      /* if there is a function call and this is
-         a parameter & not my parameter then don't pack it */
-      if ((dic->op == CALL || dic->op == PCALL) &&
-         (OP_SYMBOL (IC_RESULT (ic))->_isparm &&
-          !OP_SYMBOL (IC_RESULT (ic))->ismyparm))
-       {
-         dic = NULL;
-         break;
-       }
-#else
       /* if there is a function call then don't pack it */
       if ((dic->op == CALL || dic->op == PCALL))
        {
          dic = NULL;
          break;
        }
-#endif
 
       if (SKIP_IC2 (dic))
        continue;
@@ -2340,20 +2318,6 @@ packRegisters (eBBlock * ebp)
            }
        }
 
-#if 0
-      /* if the condition of an if instruction
-         is defined in the previous instruction then
-         mark the itemp as a conditional */
-      if ((IS_CONDITIONAL (ic) ||
-          (IS_BITWISE_OP(ic) && isBitwiseOptimizable (ic))) &&
-         ic->next && ic->next->op == IFX &&
-         isOperandEqual (IC_RESULT (ic), IC_COND (ic->next)) &&
-         OP_SYMBOL (IC_RESULT (ic))->liveTo <= ic->next->seq)
-       {
-         OP_SYMBOL (IC_RESULT (ic))->regType = REG_CND;
-         continue;
-       }
-#else
       /* if the condition of an if instruction
          is defined in the previous instruction and
         this is the only usage then
@@ -2368,7 +2332,6 @@ packRegisters (eBBlock * ebp)
          OP_SYMBOL (IC_RESULT (ic))->regType = REG_CND;
          continue;
        }
-#endif
 
       /* reduce for support function calls */
       if (ic->supportRtn || ic->op == '+' || ic->op == '-')