]> git.gag.com Git - fw/sdcc/blobdiff - src/SDCCcse.c
IC_RESULT needs to be a symbol
[fw/sdcc] / src / SDCCcse.c
index b720c2622ab23a0aeee729d6c24a8d317602ff2d..af3d2ce94a0372abbfc4b8bcac47fcb002eecb51 100644 (file)
@@ -118,7 +118,9 @@ replaceAllSymBySym (iCode * ic, operand * from, operand * to, bitVect ** ndpset)
 {
   iCode *lic;
 
-  LRH(printf ("replaceAllSymBySym: from %s to %s\n", OP_SYMBOL(from)->name, OP_SYMBOL(to)->name));
+  LRH(printf ("replaceAllSymBySym: from %s to %s\n", 
+             OP_SYMBOL(from)->name, 
+             IS_SYMOP(to) ? OP_SYMBOL(to)->name) : "!SYM");
   for (lic = ic; lic; lic = lic->next)
     {
       int siaddr;
@@ -156,7 +158,8 @@ replaceAllSymBySym (iCode * ic, operand * from, operand * to, bitVect ** ndpset)
          continue;
        }
 
-      if (IC_RESULT (lic) && IC_RESULT (lic)->key == from->key)
+      if (IS_SYMOP(to) && 
+         IC_RESULT (lic) && IC_RESULT (lic)->key == from->key)
        {
          /* maintain du chains */
          if (POINTER_SET (lic))