A skeleton for a regression fix.
[fw/sdcc] / src / SDCCcse.c
index 827431ce719059a6aa4fdf37a2aec6f5e629ca37..45a0aef708ffb048489b391d6b610f53c41f9b08 100644 (file)
@@ -328,9 +328,12 @@ DEFSETFUNC (findCheaperOp)
 
       if ((*opp)->type==VALUE && 
          IS_SYMOP(cop) && IS_GENPTR(OP_SYMBOL(cop)->type)) {
-       // this is a pointer to some space, so we can not
-       *opp=NULL;
-       return 0;
+       // 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;