catched symbol abuse
[fw/sdcc] / src / mcs51 / gen.c
index 5c7693f79505116e985aa7b5f67e03e909bf1ded..0dbce03e4faf9c3df3f406c97f7eb92a96305232 100644 (file)
@@ -1548,10 +1548,13 @@ saveRegisters (iCode * lic)
 
   /* if the registers have been saved already or don't need to be then
      do nothing */
-  if (ic->regsSaved || IFFUNC_CALLEESAVES(OP_SYMBOL(IC_LEFT(ic))->type) ||
-      IFFUNC_ISNAKED(OP_SYM_TYPE(IC_LEFT (ic))))
+  if (ic->regsSaved)
     return;
-
+  if (IS_SYMOP(IC_LEFT(ic)) &&
+      (IFFUNC_CALLEESAVES(OP_SYMBOL(IC_LEFT(ic))->type) ||
+       IFFUNC_ISNAKED(OP_SYM_TYPE(IC_LEFT (ic)))))
+    return;
+  
   /* safe the registers in use at this time but skip the
      ones for the result */
   rsave = bitVectCplAnd (bitVectCopy (ic->rMask),