From 4d4538128efab335fee5f6425a91f00665c3be55 Mon Sep 17 00:00:00 2001 From: johanknol Date: Sun, 26 Jan 2003 13:25:28 +0000 Subject: [PATCH] * src/SDCCglue.c: reverted back to 1.124 * src/SDCCast.c: reverted back to 1.156 * src/mcs51/gen.c (aopGet): applied Frieder's efficiency patch git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2178 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 6 ++++++ src/SDCCast.c | 10 ++-------- src/SDCCglue.c | 2 -- src/mcs51/gen.c | 6 ++++++ 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 27cd4f80..933f3e0b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-01-26 + + * src/SDCCglue.c: reverted back to 1.124 + * src/SDCCast.c: reverted back to 1.156 + * src/mcs51/gen.c (aopGet): applied Frieder's efficiency patch + 2003-01-25 * src/SDCCglue.c: A better fix for bug #661910 diff --git a/src/SDCCast.c b/src/SDCCast.c index b4933cb2..c92f179b 100644 --- a/src/SDCCast.c +++ b/src/SDCCast.c @@ -972,8 +972,7 @@ createIvalCharPtr (ast * sym, sym_link * type, ast * iexpr) memmap *segment=SPEC_OCLS(sym->etype); deleteSetItem(&segment->syms, sym); } - - return decorateType(resolveSymbols (rast)); + return decorateType (resolveSymbols (rast)); } return NULL; @@ -1058,9 +1057,8 @@ gatherAutoInit (symbol * autoChain) { /* resolve the symbols in the ival */ - if (sym->ival) { + if (sym->ival) resolveIvalSym (sym->ival); - } /* if this is a static variable & has an */ /* initial value the code needs to be lifted */ @@ -1231,10 +1229,6 @@ bool constExprTree (ast *cexpr) { // a function's address will never change return TRUE; } - if (IS_AST_SYM_VALUE(cexpr) && IS_ARRAY(AST_SYMBOL(cexpr)->type)) { - // an array's address will never change - return TRUE; - } if (IS_AST_SYM_VALUE(cexpr) && IN_CODESPACE(SPEC_OCLS(AST_SYMBOL(cexpr)->etype))) { // a symbol in code space will never change diff --git a/src/SDCCglue.c b/src/SDCCglue.c index 3be7fce5..59f82998 100644 --- a/src/SDCCglue.c +++ b/src/SDCCglue.c @@ -1154,8 +1154,6 @@ emitStaticSeg (memmap * map, FILE * out) resolveIvalSym (sym->ival); printIval (sym, sym->type, sym->ival, out); noAlloc--; - // now we don't need sym->ival anymore - deleteSetItem(&map->syms, list2val(sym->ival)->sym); } else { /* allocate space */ diff --git a/src/mcs51/gen.c b/src/mcs51/gen.c index 0d8b03c3..0daad8e2 100644 --- a/src/mcs51/gen.c +++ b/src/mcs51/gen.c @@ -859,6 +859,12 @@ aopGet (asmop * aop, int offset, bool bit16, bool dname) return rs; case AOP_DPTR: + if (aop->code && aop->coff==0 && offset>=1) { + emitcode ("mov", "a,#0x%02x", offset); + emitcode ("movc", "a,@a+dptr"); + return (dname ? "acc" : "a"); + } + while (offset > aop->coff) { emitcode ("inc", "dptr"); -- 2.30.2