* src/SDCCglue.c: reverted back to 1.124
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 26 Jan 2003 13:25:28 +0000 (13:25 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 26 Jan 2003 13:25:28 +0000 (13:25 +0000)
* 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
src/SDCCast.c
src/SDCCglue.c
src/mcs51/gen.c

index 27cd4f805c65814765eba307a85a64b0839b4377..933f3e0be4a77b0b40d2c57259dc78c6f586d67b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2003-01-26    <johan@balder>
+
+       * 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    <johan@balder>
 
        * src/SDCCglue.c: A better fix for bug #661910
index b4933cb2b5c3fbd7ad4613f00ebbaa5a49756317..c92f179b3b1aeb2086d18e374432f25a505db952 100644 (file)
@@ -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
index 3be7fce54000900fefcadce09074a59d2125a7db..59f82998c0ae74494db1f6ab87f58f442fff2a36 100644 (file)
@@ -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 */
index 0d8b03c3d8701c85278a1e481ef5663fe92288bc..0daad8e21d17fdcabd22d9efc3be83d2f62380c6 100644 (file)
@@ -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");