]> git.gag.com Git - fw/sdcc/commitdiff
fixed bug #444971
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 1 Aug 2001 11:34:14 +0000 (11:34 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 1 Aug 2001 11:34:14 +0000 (11:34 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1119 4a8a32a2-be11-0410-ad9d-d568d2c75423

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

index 0481331e46e0c9bf23d2e63970a57c600024d807..6be8ac2ae54277ea06ad742693ad95ff56f29eb2 100644 (file)
@@ -2943,9 +2943,7 @@ genEndFunction (iCode * ic)
        emitcode ("setb", "ea");
 
       /* if debug then send end of function */
-/*  if (options.debug && currFunc)  */
-      if (currFunc)
-       {
+      if (options.debug && currFunc) {
          _G.debugLine = 1;
          emitcode ("", "C$%s$%d$%d$%d ==.",
                    FileBaseName (ic->filename), currFunc->lastLine,
@@ -2983,7 +2981,7 @@ genEndFunction (iCode * ic)
        }
 
       /* if debug then send end of function */
-      if (currFunc)
+      if (options.debug && currFunc)
        {
          _G.debugLine = 1;
          emitcode ("", "C$%s$%d$%d$%d ==.",
index a9a66ceac515e548dd779d637674e6f73ee0d139..c9307ee386f160d783808e269621af4067bbb86e 100644 (file)
@@ -1920,6 +1920,16 @@ packRegsForOneuse (iCode * ic, operand * op, eBBlock * ebp)
                         bitVectFirstBit (OP_DEFS (op)))))
     return NULL;
 
+  /* if that only usage is a cast */
+  if (dic->op == CAST) {
+    /* to a bigger type */
+    if (getSize(OP_SYM_TYPE(IC_RESULT(dic))) > 
+       getSize(OP_SYM_TYPE(IC_RIGHT(dic)))) {
+      /* than we can not, since we cannot predict the usage of b & acc */
+      return NULL;
+    }
+  }
+
   /* found the definition now check if it is local */
   if (dic->seq < ebp->fSeq ||
       dic->seq > ebp->lSeq)
index 78725f19686023b03b2396b8423ef8041c9ed76c..2c38a068d64bb89f14ae334c886a7bd4f134ad9f 100644 (file)
@@ -28,6 +28,9 @@
       Made everything static
 -------------------------------------------------------------------------*/
 
+#define D
+//#define D(x) x
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -1611,6 +1614,8 @@ genIpush (iCode * ic)
   int size, offset = 0;
   char *l;
 
+  D(emitcode (";", "genIpush"));
+
   /* if this is not a parm push : ie. it is spill push
      and spill push is always done on the local stack */
   if (!ic->parmPush)
@@ -1839,6 +1844,7 @@ genCall (iCode * ic)
   bool restoreBank = FALSE;
   bool swapBanks = FALSE;
 
+  D(emitcode(";", "genCall"));
   /* if send set is not empty the assign */
   if (_G.sendSet)
     {
@@ -8146,6 +8152,8 @@ genCast (iCode * ic)
   operand *right = IC_RIGHT (ic);
   int size, offset;
 
+  D(emitcode(";", "genCast"));
+
   /* if they are equivalent then do nothing */
   if (operandsEqu (IC_RESULT (ic), IC_RIGHT (ic)))
     return;
index aa49eebf0cd0419623609992051f16a041231eec..6b9c977a9b09c35e22fa2eddc33487e883e89772 100644 (file)
@@ -1902,6 +1902,16 @@ packRegsForOneuse (iCode * ic, operand * op, eBBlock * ebp)
                         bitVectFirstBit (OP_DEFS (op)))))
     return NULL;
 
+  /* if that only usage is a cast */
+  if (dic->op == CAST) {
+    /* to a bigger type */
+    if (getSize(OP_SYM_TYPE(IC_RESULT(dic))) > 
+       getSize(OP_SYM_TYPE(IC_RIGHT(dic)))) {
+      /* than we can not, since we cannot predict the usage of b & acc */
+      return NULL;
+    }
+  }
+
   /* found the definition now check if it is local */
   if (dic->seq < ebp->fSeq ||
       dic->seq > ebp->lSeq)