A skeleton for a regression fix.
[fw/sdcc] / src / SDCCcse.c
index 1420b8ffbfef486131d24a6b859c6446847d11d6..45a0aef708ffb048489b391d6b610f53c41f9b08 100644 (file)
@@ -327,11 +327,13 @@ DEFSETFUNC (findCheaperOp)
        }
 
       if ((*opp)->type==VALUE && 
-         IS_SYMOP(cop) && 
-         !IS_SPEC(OP_SYMBOL(cop)->type)) {
-       // this could be a pointer to some space, so we can not
-       *opp=NULL;
-       return 0;
+         IS_SYMOP(cop) && IS_GENPTR(OP_SYMBOL(cop)->type)) {
+       // This is a value assigned to a gpointer
+       if (1) {
+         // this value is used for a cast, so we can not
+         *opp=NULL;
+         return 0;
+       }       
       }
 
       return 1;
@@ -901,6 +903,7 @@ updateSpillLocation (iCode * ic, int induction)
                /* special case for inductions */
                if (induction && 
                    OP_SYMBOL(IC_RIGHT(ic))->isreqv && 
+                   !OP_SYMBOL(IC_RESULT (ic))->noSpilLoc &&
                    !SPIL_LOC(IC_RESULT(ic))) {
                        SPIL_LOC (IC_RESULT (ic)) = SPIL_LOC (IC_RIGHT (ic));
                }