removed a warning
[fw/sdcc] / src / mcs51 / ralloc.c
index a5a61a86d667d0785436453bf504c8c1ba7eac5b..aafd4dcd9314cec8f706e998877855d0ce42e13c 100644 (file)
@@ -393,9 +393,11 @@ noOverLap (set * itmpStack, symbol * fsym)
   for (sym = setFirstItem (itmpStack); sym;
        sym = setNextItem (itmpStack))
     {
-      if (sym->liveTo > fsym->liveFrom)
-       return 0;
+           if (sym->liveFrom < fsym->liveTo &&
+               sym->liveTo   > fsym->liveTo) return 0;
 
+           if (sym->liveFrom < fsym->liveFrom &&
+               sym->liveTo > fsym->liveFrom) return 0;
     }
 
   return 1;
@@ -1889,7 +1891,7 @@ packRegsForOneuse (iCode * ic, operand * op, eBBlock * ebp)
 
   /* only upto 2 bytes since we cannot predict
      the usage of b, & acc */
-  if (getSize (operandType (op)) > (fReturnSize - 2) &&
+  if (getSize (operandType (op)) > (fReturnSizeMCS51 - 2) &&
       ic->op != RETURN &&
       ic->op != SEND &&
       !POINTER_SET (ic) &&
@@ -2011,22 +2013,22 @@ static bool
 isBitwiseOptimizable (iCode * ic)
 {
   sym_link *ltype = getSpec (operandType (IC_LEFT (ic)));
-  sym_link *rtype = getSpec (operandType (IC_RIGHT (ic)));
+  // jwk sym_link *rtype = getSpec (operandType (IC_RIGHT (ic)));
 
   /* bitwise operations are considered optimizable
      under the following conditions (Jean-Louis VERN) 
 
-     x & lit
+     x & lit   <== jwk: should be x && lit
      bit & bit
      bit & x
      bit ^ bit
      bit ^ x
-     x   ^ lit
-     x   | lit
+     x   ^ lit <== jwk: should be x ^^ lit
+     x   | lit <== jwk: should be x || lit
      bit | bit
      bit | x
    */
-  if (IS_LITERAL (rtype) ||
+  if ( /* jwk IS_LITERAL (rtype) || */
       (IS_BITVAR (ltype) && IN_BITSPACE (SPEC_OCLS (ltype))))
     return TRUE;
   else
@@ -2227,8 +2229,6 @@ packRegisters (eBBlock * ebp)
       /* TrueSym := iTempNN:1             */
       for (ic = ebp->sch; ic; ic = ic->next)
        {
-
-
          /* find assignment of the form TrueSym := iTempNN:1 */
          if (ic->op == '=' && !POINTER_SET (ic))
            change += packRegsForAssign (ic, ebp);
@@ -2322,15 +2322,11 @@ packRegisters (eBBlock * ebp)
          is defined in the previous instruction then
          mark the itemp as a conditional */
       if ((IS_CONDITIONAL (ic) ||
-          ((ic->op == BITWISEAND ||
-            ic->op == '|' ||
-            ic->op == '^') &&
-           isBitwiseOptimizable (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;
        }
@@ -2508,7 +2504,7 @@ mcs51_assignRegisters (eBBlock ** ebbs, int count)
   if (options.dump_rassgn)
     {
       dumpEbbsToFileExt (".dumprassgn", ebbs, count);
-      dumpLiveRanges (".lrange", liveRanges);
+      dumpLiveRanges (".dumplrange", liveRanges);
     }
 
   /* do the overlaysegment stuff SDCCmem.c */