From d87a95d37564d1793ba5420cf1fdae4b138e24e4 Mon Sep 17 00:00:00 2001 From: johanknol Date: Thu, 29 Mar 2001 15:39:25 +0000 Subject: [PATCH] --stack-auto and --int-long-reent related things git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@720 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/SDCCsymt.c | 4 +--- src/mcs51/main.c | 2 +- src/mcs51/ralloc.c | 23 ++++++++++++++++++----- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/SDCCsymt.c b/src/SDCCsymt.c index 9349511d..b9f90da1 100644 --- a/src/SDCCsymt.c +++ b/src/SDCCsymt.c @@ -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)) { diff --git a/src/mcs51/main.c b/src/mcs51/main.c index fd112809..05f50f11 100644 --- a/src/mcs51/main.c +++ b/src/mcs51/main.c @@ -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 diff --git a/src/mcs51/ralloc.c b/src/mcs51/ralloc.c index aafd4dcd..82cb8ebc 100644 --- a/src/mcs51/ralloc.c +++ b/src/mcs51/ralloc.c @@ -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 */ -- 2.30.2