From: jtvolpe Date: Fri, 20 Apr 2001 02:14:47 +0000 (+0000) Subject: Fixed mixed signed/unsigned compare X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=9d5f12eb51d5fb0966bf499cd271fd7cb270ee10;p=fw%2Fsdcc Fixed mixed signed/unsigned compare git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@745 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/avr/gen.c b/src/avr/gen.c index 5496080c..28667c5d 100644 --- a/src/avr/gen.c +++ b/src/avr/gen.c @@ -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; } diff --git a/src/ds390/ralloc.c b/src/ds390/ralloc.c index d9b7eab3..9d5fbc76 100644 --- a/src/ds390/ralloc.c +++ b/src/ds390/ralloc.c @@ -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;