]> git.gag.com Git - fw/sdcc/commitdiff
fixed bug #507904
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 24 Jan 2002 11:16:56 +0000 (11:16 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 24 Jan 2002 11:16:56 +0000 (11:16 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1838 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/ds390/gen.c
src/ds390/ralloc.c
src/mcs51/gen.c
src/mcs51/ralloc.c
src/xa51/gen.c
src/xa51/main.c

index 8c6190f5539bd74753baaa9e581235f306233ab1..92e7ac9b3588b5a188baad9a45caa0b04a4652bf 100644 (file)
@@ -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)
            {
index a7d7800bd15e9ec6348b97c7efbc3b0bd0535107..d91d0a35343e0dee6a8a988a7fed2bfe842bf0ba 100644 (file)
@@ -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)
index 25ed34b5c37cf60e34fb0e0d4cccb529c6d2070c..383d148e4b180d9d806902c8f6fdaee6edc3efdb 100644 (file)
@@ -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)
            {
index 1498a51c41846b66e3c4e18e3836a2622cacccff..18eb37a993e4b6b088634eae6c4ce0485c92eb92 100644 (file)
@@ -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)
index bbe49199c34ed364aae25676df0cd8ccf89cf8d4..51a226da77922a143a71e1fe20bad371e1ac986f 100755 (executable)
@@ -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 ==.",
index b92ae24c744ef20932871785d01d1cb97541be14..0a465ca1065392da6ebaad963d6943e969a7ef60 100755 (executable)
@@ -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 */