fixed a optimizer bug for longs
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 26 Oct 2001 12:25:46 +0000 (12:25 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 26 Oct 2001 12:25:46 +0000 (12:25 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1445 4a8a32a2-be11-0410-ad9d-d568d2c75423

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

index 57fb46cdd93b33bf032a4a416716f170270ff209..40bc1c86b7ed9ce886eede19061e7ea99fb1d40e 100644 (file)
@@ -1897,13 +1897,15 @@ packRegsForOneuse (iCode * ic, operand * op, eBBlock * ebp)
 
   /* only upto 2 bytes since we cannot predict
      the usage of b, & acc */
-  if (getSize (operandType (op)) > (fReturnSizeDS390 - 2) &&
-      ic->op != RETURN &&
+  if (getSize (operandType (op)) > (fReturnSizeDS390 - 2))
+    return 0;
+
+  if (ic->op != RETURN &&
       ic->op != SEND &&
       !POINTER_SET (ic) &&
       !POINTER_GET (ic))
     return NULL;
-
+  
   /* this routine will mark the a symbol as used in one 
      instruction use only && if the defintion is local 
      (ie. within the basic block) && has only one definition &&
index 40043820f68cfd7e44ee85f8f87e33984e81651e..bcb0fa3686c7f01d8e6890c4fbb6923393973719 100644 (file)
@@ -1875,13 +1875,15 @@ packRegsForOneuse (iCode * ic, operand * op, eBBlock * ebp)
 
   /* only upto 2 bytes since we cannot predict
      the usage of b, & acc */
-  if (getSize (operandType (op)) > (fReturnSizeMCS51 - 2) &&
-      ic->op != RETURN &&
+  if (getSize (operandType (op)) > (fReturnSizeMCS51 - 2))
+    return NULL;
+
+  if (ic->op != RETURN &&
       ic->op != SEND &&
       !POINTER_SET (ic) &&
       !POINTER_GET (ic))
     return NULL;
-
+  
   /* this routine will mark the a symbol as used in one 
      instruction use only && if the defintion is local 
      (ie. within the basic block) && has only one definition &&