fixed two problems
authorsandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 1 Feb 2000 17:47:18 +0000 (17:47 +0000)
committersandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 1 Feb 2000 17:47:18 +0000 (17:47 +0000)
a) variables declared as "bit" should not be assigned to registers
b) should not reorder instructions if there is a volatile assignment

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

src/SDCCicode.c
src/mcs51/ralloc.c

index fa19b13f8d149e731e1010bd19dafee0e098a5cd..f359c917d7c8dd411a8040ffbe20905588dfe44d 100644 (file)
@@ -1027,8 +1027,10 @@ operand *operandFromSymbol (symbol *sym)
        !sym->reqv               &&     /* does not already have a register euivalence */
        !IS_VOLATILE(sym->etype) &&     /* not declared as volatile */
        !IS_STATIC(sym->etype)   &&     /* and not declared static  */
-       !sym->islbl              &&
-       !IN_FARSPACE(SPEC_OCLS(sym->etype))) {     /* not a label */
+       !sym->islbl              &&     /* not a label */
+       !IN_FARSPACE(SPEC_OCLS(sym->etype)) && /* not in far space */
+       !IS_BITVAR(sym->etype)          /* not a bit variable */
+       ) {
        
        /* we will use it after all optimizations
           and before liveRange calculation */
index 54e64a4dede18fddcd16fb8ace1aede448b5a542..aa4e64b47fceae28540e8ccfeb1606214281fb37 100644 (file)
@@ -1485,7 +1485,13 @@ static int packRegsForAssign (iCode *ic,eBBlock *ebp)
 
        if (SKIP_IC2(dic))
            continue;
-       
+
+       if (IS_TRUE_SYMOP(IC_RESULT(dic)) &&
+           IS_OP_VOLATILE(IC_RESULT(dic))) {
+               dic = NULL;
+               break;
+       }
+
        if (IS_SYMOP(IC_RESULT(dic)) &&
            IC_RESULT(dic)->key == IC_RIGHT(ic)->key) {
            if (POINTER_SET(dic))