was generating bad code for situations like
authorsandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 25 Feb 2000 23:35:19 +0000 (23:35 +0000)
committersandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 25 Feb 2000 23:35:19 +0000 (23:35 +0000)
a & b (a and b both ints sizeof() > 1)

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@128 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/mcs51/ralloc.c

index 0f01e758b96233da85799425a7aa13ee03dfc82e..45c9e18ddfa1c629a466cba034f20149b03cbc80 100644 (file)
@@ -1456,13 +1456,12 @@ static int packRegsForAssign (iCode *ic,eBBlock *ebp)
 {
     iCode *dic, *sic;
     
-    if (
-/*     !IS_TRUE_SYMOP(IC_RESULT(ic)) ||            */
-       !IS_ITEMP(IC_RIGHT(ic))       ||        
-       OP_LIVETO(IC_RIGHT(ic)) > ic->seq ||
-       OP_SYMBOL(IC_RIGHT(ic))->isind)
+    if (!IS_ITEMP(IC_RIGHT(ic))       ||       
+       OP_SYMBOL(IC_RIGHT(ic))->isind ||
+       OP_LIVETO(IC_RIGHT(ic)) > ic->seq) {
        return 0;
-        
+    }
+       
     /* if the true symbol is defined in far space or on stack
        then we should not since this will increase register pressure */
     if (isOperandInFarSpace(IC_RESULT(ic))) {
@@ -1881,6 +1880,10 @@ static void packRegsForAccUse (iCode *ic)
          getSize(operandType(IC_RESULT(ic))) > 1))
        return ;
        
+    if (IS_BITWISE_OP(ic) &&
+       getSize(operandType(IC_RESULT(ic))) > 1)
+       return ;
+           
        
     /* has only one definition */
     if (bitVectnBitsOn(OP_DEFS(IC_RESULT(ic))) > 1)