--stack-auto and --int-long-reent related things
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 29 Mar 2001 15:39:25 +0000 (15:39 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 29 Mar 2001 15:39:25 +0000 (15:39 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@720 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCsymt.c
src/mcs51/main.c
src/mcs51/ralloc.c

index 9349511d9f89ec36c717e8c112ad906a43ae8c82..b9f90da1bba29f4343d985d1615d8ae21d19e29f 100644 (file)
@@ -1055,7 +1055,6 @@ checkSClass (symbol * sym)
        SPEC_SCLS (sym->etype) != S_XSTACK &&
        SPEC_SCLS (sym->etype) != S_CONSTANT))
     {
-
       werror (E_AUTO_ASSUMED, sym->name);
       SPEC_SCLS (sym->etype) = S_AUTO;
     }
@@ -1620,8 +1619,7 @@ processFuncArgs (symbol * func, int ignoreName)
     {
       /* mark it as a register parameter if
          the function does not have VA_ARG
-         and as port dictates
-         not inhibited by command line option or #pragma */
+         and as port dictates */
       if (!func->hasVargs &&
          (*port->reg_parm) (val->type))
        {
index fd112809cc82708405088f5a179e57cf902179e5..05f50f114be03f54d2dfd0f42cff99cc6903fd7a 100644 (file)
@@ -84,7 +84,7 @@ static void
 _mcs51_finaliseOptions (void)
 {
   if (options.model == MODEL_LARGE) {
-      port->mem.default_local_map = data;
+      port->mem.default_local_map = xdata;
       port->mem.default_globl_map = xdata;
     }
   else
index aafd4dcd9314cec8f706e998877855d0ce42e13c..82cb8ebc628445a4ada8f11147907b294c721d77 100644 (file)
@@ -1913,7 +1913,7 @@ packRegsForOneuse (iCode * ic, operand * op, eBBlock * ebp)
   if (bitVectnBitsOn (OP_DEFS (op)) > 1)
     return NULL;               /* has more than one definition */
 
-  /* get the that definition */
+  /* get that definition */
   if (!(dic =
        hTabItemWithKey (iCodehTab,
                         bitVectFirstBit (OP_DEFS (op)))))
@@ -1999,6 +1999,12 @@ packRegsForOneuse (iCode * ic, operand * op, eBBlock * ebp)
        {
          return NULL;
        }
+      /* if left or right or result is on stack */
+      if (isOperandOnStack(IC_LEFT(dic)) ||
+         isOperandOnStack(IC_RIGHT(dic)) ||
+         isOperandOnStack(IC_RESULT(dic))) {
+       return NULL;
+      }
     }
 
   OP_SYMBOL (op)->ruonly = 1;
@@ -2197,8 +2203,9 @@ packForPush (iCode * ic, eBBlock * ebp)
   /* make sure the right side does not have any definitions
      inbetween */
   dbv = OP_DEFS(IC_RIGHT(dic));
-  for (lic = ic; lic != dic ; lic = lic->prev) {
-         if (bitVectBitValue(dbv,lic->key)) return ;
+  for (lic = ic; lic && lic != dic ; lic = lic->prev) {
+    if (bitVectBitValue(dbv,lic->key)) 
+      return ;
   }
   /* we now we know that it has one & only one def & use
      and the that the definition is an assignment */
@@ -2339,8 +2346,14 @@ packRegisters (eBBlock * ebp)
          can be eliminated for return statements */
       if ((ic->op == RETURN || ic->op == SEND) &&
          !isOperandInFarSpace (IC_LEFT (ic)) &&
-         options.model == MODEL_SMALL)
-       packRegsForOneuse (ic, IC_LEFT (ic), ebp);
+         options.model == MODEL_SMALL) {
+       if (0 && options.stackAuto) {
+         /* we should check here if acc will be clobbered for stack
+            offset calculations */
+       } else {
+         packRegsForOneuse (ic, IC_LEFT (ic), ebp);
+       }
+      }
 
       /* if pointer set & left has a size more than
          one and right is not in far space */