* src/mcs51/gen.c (genCpl): quick fix for bug #974835
[fw/sdcc] / src / SDCCmem.c
index ba185d241e3da2d5a2e5e95dcc43c705040ada54..2f55cf2d49c41ce45bf717e4709e2761ac3eff1d 100644 (file)
@@ -816,6 +816,7 @@ allocVariables (symbol * symChain)
          if (csym && csym->level == sym->level)
            werror (E_DUPLICATE_TYPEDEF, sym->name);
 
+         SPEC_EXTR (sym->etype) = 0;
          addSym (TypedefTab, sym, sym->name, sym->level, sym->block, 0);
          continue;             /* go to the next one         */
        }
@@ -994,11 +995,18 @@ printAllocInfoSeg (memmap * map, symbol * func, FILE * of)
          int i;
 
          sym = OP_SYMBOL (sym->reqv);
-         fprintf (of, "to registers ");
-         for (i = 0; i < 4 && sym->regs[i]; i++)
-           fprintf (of, "%s ", port->getRegName (sym->regs[i]));
-         fprintf (of, "\n");
-         continue;
+         if (!sym->isspilt || sym->remat)
+           {
+             fprintf (of, "to registers ");
+             for (i = 0; i < 4 && sym->regs[i]; i++)
+               fprintf (of, "%s ", port->getRegName (sym->regs[i]));
+             fprintf (of, "\n");
+             continue;
+           }
+         else
+           {
+             sym = sym->usl.spillLoc;
+           }
        }
 
       /* if on stack */