* src/z80/gen.c (genXor): Fixed bug #805445
[fw/sdcc] / src / z80 / ralloc.c
index 5cd9ac0f259daf5327ca63c7de1604b221f5f28e..9eaebde377de754f1941dd4f87da46ccdd7b6e82 100644 (file)
@@ -796,6 +796,9 @@ static regs *getRegGprNoSpil()
       return reg;
     }
   assert(0);
+
+  /* just to make the compiler happy */
+  return 0;
 }
 
 /** Symbol has a given register.
@@ -1228,7 +1231,8 @@ static void fillGaps()
                bitVectBitValue(_G.totRegAssigned,i) == 0) /* and are still assigned to registers */
                continue ;
 
-           assert (clr = hTabItemWithKey(liveRanges,i));
+           clr = hTabItemWithKey(liveRanges,i);
+           assert(clr);
         
            /* mark these registers as used */
            for (k = 0 ; k < clr->nRegs ; k++ ) 
@@ -1671,7 +1675,7 @@ pack:
   // PENDING: Check vs mcs51
   bitVectUnSetBit(OP_SYMBOL(IC_RESULT(ic))->defs,ic->key);
   hTabDeleteItem (&iCodehTab, ic->key, ic, DELETE_ITEM, NULL);
-  OP_DEFS (IC_RESULT (dic)) = bitVectSetBit (OP_DEFS (IC_RESULT (dic)), dic->key);
+  OP_DEFS(IC_RESULT (dic))=bitVectSetBit (OP_DEFS (IC_RESULT (dic)), dic->key);
   return 1;
 }
 
@@ -2876,6 +2880,7 @@ packRegisters (eBBlock * ebp)
       /* if pointer get */
       if (!DISABLE_PACK_ONE_USE &&
          POINTER_GET (ic) &&
+         IS_SYMOP (IC_LEFT (ic)) &&
       /* MLH: dont have far space
          !isOperandInFarSpace(IC_RESULT(ic))&& */
          !OP_SYMBOL (IC_LEFT (ic))->remat &&
@@ -2959,7 +2964,7 @@ joinPushes (iCode *lic)
       first = (int)operandLitValue ( IC_LEFT (ic));
       second = (int)operandLitValue ( IC_LEFT (uic));
 
-      sprintf (buffer, "%u", ((first << 8) | (second & 0xFF)) & 0xFFFFU);
+      sprintf (buffer, "%uu", ((first << 8) | (second & 0xFF)) & 0xFFFFU);
       val = constVal (buffer);
       SPEC_NOUN (val->type) = V_INT;
       IC_LEFT (ic)->operand.valOperand = val;