X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2FSDCCmem.c;h=5fe82651fe47e1de45281948dfc7140f71fca936;hb=ee51721298002c4e552b64a649ac3fdbd0de2926;hp=54c8d0122bc92c5261b0e041b4f1458aa6082f0e;hpb=4d406d0af5861a351d089724c5f3e6d1ee8f70d4;p=fw%2Fsdcc diff --git a/src/SDCCmem.c b/src/SDCCmem.c index 54c8d012..5fe82651 100644 --- a/src/SDCCmem.c +++ b/src/SDCCmem.c @@ -325,9 +325,9 @@ allocGlobal (symbol * sym) SPEC_OCLS (sym->etype) = code; /* if this is an interrupt service routine then put it in the interrupt service array */ - if (FUNC_ISISR (sym->type) && !options.noiv) + if (FUNC_ISISR (sym->type) && !options.noiv + && (FUNC_INTNO (sym->type) != INTNO_UNSPEC)) { - if (interrupts[FUNC_INTNO (sym->type)]) werror (E_INT_DEFINED, FUNC_INTNO (sym->type), @@ -351,14 +351,6 @@ allocGlobal (symbol * sym) SPEC_SCLS (sym->etype) == S_SBIT) { - /* if both absolute address & initial */ - /* value specified then error */ - if (IS_ABSOLUTE (sym->etype) && sym->ival) - { - werror (E_SFR_INIT, sym->name); - sym->ival = NULL; - } - SPEC_OCLS (sym->etype) = (SPEC_SCLS (sym->etype) == S_SFR ? sfr : sfrbit); @@ -571,8 +563,9 @@ deallocParms (value * val) if (!lval->sym->isref) { lval->sym->allocreq = 0; - werror (W_NO_REFERENCE, currFunc->name, - "function argument", lval->sym->name); + werror (W_NO_REFERENCE, + currFunc ? currFunc->name : "(unknown)", + "function argument", lval->sym->name); } /* move the rname if any to the name for both val & sym */ @@ -683,15 +676,6 @@ allocLocal (symbol * sym) if (SPEC_SCLS (sym->etype) == S_SFR || SPEC_SCLS (sym->etype) == S_SBIT) { - - /* if both absolute address & initial */ - /* value specified then error */ - if (IS_ABSOLUTE (sym->etype) && sym->ival) - { - werror (E_SFR_INIT, sym->name); - sym->ival = NULL; - } - SPEC_OCLS (sym->etype) = (SPEC_SCLS (sym->etype) == S_SFR ? sfr : sfrbit); @@ -726,11 +710,11 @@ allocLocal (symbol * sym) will remove and put into the 'data' segment if required after overlay analysis has been done */ if (options.model == MODEL_SMALL) { - SPEC_OCLS (sym->etype) = - (options.noOverlay ? port->mem.default_local_map - : overlay); + SPEC_OCLS (sym->etype) = + (options.noOverlay ? port->mem.default_local_map + : overlay); } else { - SPEC_OCLS (sym->etype) = port->mem.default_local_map; + SPEC_OCLS (sym->etype) = port->mem.default_local_map; } allocIntoSeg (sym); } @@ -758,7 +742,8 @@ deallocLocal (symbol * csym) } /* if not used give a warning */ if (!sym->isref && !IS_STATIC (sym->etype)) - werror (W_NO_REFERENCE, currFunc->name, + werror (W_NO_REFERENCE, + currFunc ? currFunc->name : "(unknown)", "local variable", sym->name); /* now delete it from the symbol table */ deleteSym (SymbolTab, sym, sym->name); @@ -781,7 +766,7 @@ overlay2data () allocIntoSeg (sym); } - setToNull ((void **) &overlay->syms); + setToNull ((void *) &overlay->syms); } @@ -802,7 +787,7 @@ overlay2Set () addSet (&oset, sym); } - setToNull ((void **) &overlay->syms); + setToNull ((void *) &overlay->syms); addSet (&ovrSetSets, oset); } @@ -977,18 +962,6 @@ redoStackOffsets (void) xsPtr += size; } - /* if the debug option is set then output the - symbols to the map file */ - if (options.debug) - { - for (sym = setFirstItem (istack->syms); sym; - sym = setNextItem (istack->syms)) - cdbSymbol (sym, cdbFile, FALSE, FALSE); - - for (sym = setFirstItem (xstack->syms); sym; - sym = setNextItem (xstack->syms)) - cdbSymbol (sym, cdbFile, FALSE, FALSE); - } } /*-----------------------------------------------------------------*/ @@ -1112,9 +1085,12 @@ doOverlays (eBBlock ** ebbs, int count) void printAllocInfo (symbol * func, FILE * of) { + if (!func) + return; + if (!of) of = stdout; - + /* must be called after register allocation is complete */ fprintf (of, ";------------------------------------------------------------\n"); fprintf (of, ";Allocation info for local variables in function '%s'\n", func->name);