From 3c14fa0febe494de4e6b32d931cd2d58db841b12 Mon Sep 17 00:00:00 2001 From: johanknol Date: Thu, 24 Jan 2002 11:16:56 +0000 Subject: [PATCH] fixed bug #507904 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1838 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/ds390/gen.c | 2 +- src/ds390/ralloc.c | 11 +++++++++++ src/mcs51/gen.c | 2 +- src/mcs51/ralloc.c | 11 +++++++++++ src/xa51/gen.c | 5 ++--- src/xa51/main.c | 7 +++++-- 6 files changed, 31 insertions(+), 7 deletions(-) diff --git a/src/ds390/gen.c b/src/ds390/gen.c index 8c6190f5..92e7ac9b 100644 --- a/src/ds390/gen.c +++ b/src/ds390/gen.c @@ -11814,7 +11814,7 @@ gen390Code (iCode * lic) for (ic = lic; ic; ic = ic->next) { - if (cln != ic->lineno) + if (ic->lineno && cln != ic->lineno) { if (options.debug) { diff --git a/src/ds390/ralloc.c b/src/ds390/ralloc.c index a7d7800b..d91d0a35 100644 --- a/src/ds390/ralloc.c +++ b/src/ds390/ralloc.c @@ -2243,6 +2243,17 @@ packRegsForAccUse (iCode * ic) return; } + /* if we are calling a reentrant function that has stack parameters */ + if (ic->op == CALL && + IFFUNC_ISREENT(operandType(IC_LEFT(ic))) && + FUNC_HASSTACKPARM(operandType(IC_LEFT(ic)))) + return; + + if (ic->op == PCALL && + IFFUNC_ISREENT(operandType(IC_LEFT(ic))->next) && + FUNC_HASSTACKPARM(operandType(IC_LEFT(ic))->next)) + return; + /* if + or - then it has to be one byte result */ if ((ic->op == '+' || ic->op == '-') && getSize (operandType (IC_RESULT (ic))) > 1) diff --git a/src/mcs51/gen.c b/src/mcs51/gen.c index 25ed34b5..383d148e 100644 --- a/src/mcs51/gen.c +++ b/src/mcs51/gen.c @@ -8808,7 +8808,7 @@ gen51Code (iCode * lic) for (ic = lic; ic; ic = ic->next) { - if (cln != ic->lineno) + if (ic->lineno && cln != ic->lineno) { if (options.debug) { diff --git a/src/mcs51/ralloc.c b/src/mcs51/ralloc.c index 1498a51c..18eb37a9 100644 --- a/src/mcs51/ralloc.c +++ b/src/mcs51/ralloc.c @@ -2244,6 +2244,17 @@ packRegsForAccUse (iCode * ic) return; } + /* if we are calling a reentrant function that has stack parameters */ + if (ic->op == CALL && + IFFUNC_ISREENT(operandType(IC_LEFT(ic))) && + FUNC_HASSTACKPARM(operandType(IC_LEFT(ic)))) + return; + + if (ic->op == PCALL && + IFFUNC_ISREENT(operandType(IC_LEFT(ic))->next) && + FUNC_HASSTACKPARM(operandType(IC_LEFT(ic))->next)) + return; + /* if + or - then it has to be one byte result */ if ((ic->op == '+' || ic->op == '-') && getSize (operandType (IC_RESULT (ic))) > 1) diff --git a/src/xa51/gen.c b/src/xa51/gen.c index bbe49199..51a226da 100755 --- a/src/xa51/gen.c +++ b/src/xa51/gen.c @@ -139,8 +139,7 @@ static void emitcode (char *inst, char *fmt,...) { char *getStackOffset(int stack) { static char gsoBuf[1024]; - // dit slaat natuurlijk nergens op, maar ja voor nou - sprintf (gsoBuf, "r7+(%+d+0%+d%+d)", stack, + sprintf (gsoBuf, "r7+(%d%+d%+d)", stack, FUNC_ISISR(currFunc->type) ? port->stack.isr_overhead : port->stack.call_overhead, _G.nRegsSaved); @@ -1337,7 +1336,7 @@ void genXA51Code (iCode * lic) { } for (ic = lic; ic; ic = ic->next) { - if (cln != ic->lineno) { + if (ic->lineno && cln != ic->lineno) { if (options.debug) { _G.debugLine = 1; emitcode ("", "C$%s$%d$%d$%d ==.", diff --git a/src/xa51/main.c b/src/xa51/main.c index b92ae24c..0a465ca1 100755 --- a/src/xa51/main.c +++ b/src/xa51/main.c @@ -127,7 +127,10 @@ _xa51_genAssemblerPreamble (FILE * of) static int _xa51_genIVT (FILE * of, symbol ** interrupts, int maxInterrupts) { - return FALSE; + fprintf (of, "\t.dw\t0x8f00\n"); + fprintf (of, "\t.dw\t__sdcc_gsinit_startup\n"); + // no IVT yet + return TRUE; } /* Generate code to copy XINIT to XISEG */ @@ -181,7 +184,7 @@ static const char *_linkCmd[] = /* $3 is replaced by assembler.debug_opts resp. port->assembler.plain_opts */ static const char *_asmCmd[] = { - "xa_asm", "$l", "$3", "$1.xa", NULL + "xa_asm -dontcomplain", "$l", "$3", "$1.xa", NULL }; /* Globals */ -- 2.30.2