Fixed mixed signed/unsigned compare
authorjtvolpe <jtvolpe@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 20 Apr 2001 02:14:47 +0000 (02:14 +0000)
committerjtvolpe <jtvolpe@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 20 Apr 2001 02:14:47 +0000 (02:14 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@745 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/avr/gen.c
src/ds390/ralloc.c

index 5496080c9a98c37cc4a77dae35bd9b06c32cd1dc..28667c5d2cd54685cf1c9f4bcb04728930f707e2 100644 (file)
@@ -164,7 +164,7 @@ hasInc (operand *op, iCode *ic)
       return lic;
     }
     /* if the operand used or deffed */
-    if (bitVectBitValue(ic->uses,op->key) || ic->defKey == op->key) {
+    if (bitVectBitValue(ic->uses,op->key) || ((unsigned) ic->defKey == op->key)) {
       return NULL;
     }
     lic = lic->next;
@@ -1876,7 +1876,7 @@ genPlusIncr (iCode * ic)
                        return TRUE;
                }
                emitcode ("subi", "%s,lo8(%d)",
-                         aopGet (AOP (IC_LEFT (ic)), 0), -icount);
+                         aopGet (AOP (IC_LEFT (ic)), 0), 0-icount);
                return TRUE;
        }
 
@@ -1893,21 +1893,21 @@ genPlusIncr (iCode * ic)
 
                /* use subi */
                emitcode ("subi", "%s,lo8(%d)",
-                         aopGet (AOP (IC_RESULT (ic)), 0), -icount);
+                         aopGet (AOP (IC_RESULT (ic)), 0), 0-icount);
                emitcode ("sbci", "%s,hi8(%d)",
-                         aopGet (AOP (IC_RESULT (ic)), 1), -icount);
+                         aopGet (AOP (IC_RESULT (ic)), 1), 0-icount);
                return TRUE;
        }
 
        /* for 32 bit longs */
        emitcode ("subi", "%s,lo8(%d)", aopGet (AOP (IC_RESULT (ic)), 0),
-                 -icount);
+                 0-icount);
        emitcode ("sbci", "%s,hi8(%d)", aopGet (AOP (IC_RESULT (ic)), 1),
-                 -icount);
+                 0-icount);
        emitcode ("sbci", "%s,hlo8(%d)", aopGet (AOP (IC_RESULT (ic)), 2),
-                 -icount);
+                 0-icount);
        emitcode ("sbci", "%s,hhi8(%d)", aopGet (AOP (IC_RESULT (ic)), 3),
-                 -icount);
+                 0-icount);
        return TRUE;
 
 }
index d9b7eab364741b80ae8642484ea8d0e18f6a66f3..9d5fbc769324699d5e780093c65b9c40ff99f0c9 100644 (file)
@@ -1169,7 +1169,7 @@ serialRegAssign (eBBlock ** ebbs, int count)
                 then mark it */
              if (POINTER_GET (ic) && IS_SYMOP (IC_LEFT (ic))
                  && getSize (OP_SYMBOL (IC_LEFT (ic))->type)
-                 <= PTRSIZE)
+                 <= (unsigned) PTRSIZE)
                {
                  ds390_ptrRegReq++;
                  ptrRegSet = 1;