Fixed pointer post increment problem
[fw/sdcc] / src / avr / ralloc.c
index 5e42b7ad7692b5245fd9a8675ef4006181b894b6..8388d84b58d95ee195c9ae7b853811bea386d81b 100644 (file)
@@ -2073,8 +2073,11 @@ packRegisters (eBBlock * ebp)
                if (POINTER_SET (ic))
                        OP_SYMBOL (IC_RESULT (ic))->uptr = 1;
 
-               if (POINTER_GET (ic))
+               if (POINTER_GET (ic)) {
                        OP_SYMBOL (IC_LEFT (ic))->uptr = 1;
+                       if (OP_SYMBOL (IC_LEFT(ic))->remat) 
+                               OP_SYMBOL (IC_RESULT (ic))->usl.spillLoc = NULL;
+               }
 
                /* if the condition of an if instruction
                   is defined in the previous instruction then
@@ -2133,7 +2136,7 @@ packRegisters (eBBlock * ebp)
 
                                /* if the type from and type to are the same
                                   then if this is the only use then packit */
-                               if (checkType (operandType (IC_RIGHT (ic)),
+                               if (compareType (operandType (IC_RIGHT (ic)),
                                               operandType (IC_LEFT (ic))) ==
                                    1) {
                                        iCode *dic =
@@ -2218,8 +2221,8 @@ setDefaultRegs (eBBlock ** ebbs, int count)
        else {
                regsAVR[R26_IDX].type = (regsAVR[R26_IDX].type & ~REG_MASK) | REG_PTR;
                regsAVR[R27_IDX].type = (regsAVR[R27_IDX].type & ~REG_MASK) | REG_PTR;
-               regsAVR[R28_IDX].type = (regsAVR[R28_IDX].type & ~REG_MASK) | REG_PTR;
-               regsAVR[R29_IDX].type = (regsAVR[R29_IDX].type & ~REG_MASK) | REG_PTR;
+               regsAVR[R30_IDX].type = (regsAVR[R30_IDX].type & ~REG_MASK) | REG_PTR;
+               regsAVR[R31_IDX].type = (regsAVR[R31_IDX].type & ~REG_MASK) | REG_PTR;
        }
 
        /* registers 0-1 / 24-25 used as scratch */