X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2FSDCCmem.c;h=432151924b415ecbfe5d3b022a84110529a3b0be;hb=44ea48587bdb833449a28658128fdaa58e7ad76f;hp=8e0db0dce41649bf11c895a6cd7c55d11eba0ea0;hpb=98a8cc0a546d822058cccec0ddb8d8498ea69b7e;p=fw%2Fsdcc diff --git a/src/SDCCmem.c b/src/SDCCmem.c index 8e0db0dc..43215192 100644 --- a/src/SDCCmem.c +++ b/src/SDCCmem.c @@ -296,6 +296,8 @@ allocIntoSeg (symbol * sym) { memmap *segment = SPEC_OCLS (sym->etype); addSet (&segment->syms, sym); + if (segment == pdata) + sym->iaccess = 1; } /*-----------------------------------------------------------------*/ @@ -416,10 +418,10 @@ allocGlobal (symbol * sym) } /* if this is a bit variable and no storage class */ - if (SPEC_NOUN (sym->etype) == V_BIT - /*&& SPEC_SCLS (sym->etype) == S_BIT*/) + if (IS_SPEC(sym->type) && SPEC_NOUN (sym->type) == V_BIT) + /*&& SPEC_SCLS (sym->etype) == S_BIT*/ { - SPEC_OCLS (sym->etype) = bit; + SPEC_OCLS (sym->type) = bit; allocIntoSeg (sym); return; } @@ -531,20 +533,27 @@ allocParms (value * val) continue; } - /* otherwise depending on the memory model - note here that we put it into the overlay segment - first, we will remove it from the overlay segment - after the overlay determination has been done */ + /* otherwise depending on the memory model */ + SPEC_OCLS (lval->etype) = SPEC_OCLS (lval->sym->etype) = + port->mem.default_local_map; if (options.model == MODEL_SMALL) { - SPEC_OCLS (lval->etype) = SPEC_OCLS (lval->sym->etype) = - (options.noOverlay ? port->mem.default_local_map - : overlay); + /* note here that we put it into the overlay segment + first, we will remove it from the overlay segment + after the overlay determination has been done */ + if (!options.noOverlay) + { + SPEC_OCLS (lval->etype) = SPEC_OCLS (lval->sym->etype) = + overlay; + } + } + else if (options.model == MODEL_MEDIUM) + { + SPEC_SCLS (lval->etype) = S_PDATA; } else { SPEC_SCLS (lval->etype) = S_XDATA; - SPEC_OCLS (lval->etype) = SPEC_OCLS (lval->sym->etype) = xdata; } allocIntoSeg (lval->sym); } @@ -663,10 +672,10 @@ allocLocal (symbol * sym) } /* if this is a bit variable and no storage class */ - if (SPEC_NOUN (sym->etype) == V_BIT - && (SPEC_SCLS (sym->etype) == S_BIT)) + if (IS_SPEC(sym->type) && SPEC_NOUN (sym->type) == V_BIT) { - SPEC_OCLS (sym->etype) = bit; + SPEC_SCLS (sym->type) = S_BIT; + SPEC_OCLS (sym->type) = bit; allocIntoSeg (sym); return; }