]> git.gag.com Git - fw/sdcc/commitdiff
fixed an integral promotion bug
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 27 Jan 2002 10:02:22 +0000 (10:02 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 27 Jan 2002 10:02:22 +0000 (10:02 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1843 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/ds390/ralloc.c

index d91d0a35343e0dee6a8a988a7fed2bfe842bf0ba..d731417dbf76deb8ffa770e67a6310d8825db95a 100644 (file)
@@ -2163,11 +2163,20 @@ packRegsDPTRuse (operand * op)
        if (POINTER_SET(ic) && !isOperandEqual(IC_RESULT(ic),op) &&
            getSize(operandType(IC_RESULT(ic))) > 1 ) return NULL;
 
-       /* conditionals can destroy 'b' - make sure B wont be used in this one*/
+       /* conditionals can destroy 'b' - make sure B wont 
+          be used in this one*/
        if ((IS_CONDITIONAL(ic) || ic->op == '*' || ic->op == '/'  || 
             ic->op == LEFT_OP || ic->op == RIGHT_OP ) && 
            getSize(operandType(op)) > 3) return NULL;
 
+       /* if this is a cast to a bigger type */
+       if (ic->op==CAST) {
+         if (getSize(OP_SYM_TYPE(IC_RESULT(ic))) >
+             getSize(OP_SYM_TYPE(IC_RIGHT(ic)))) {
+           return 0;
+         }
+       }
+
        /* general case */
        if (IC_RESULT(ic) && IS_SYMOP(IC_RESULT(ic)) && 
            !isOperandEqual(IC_RESULT(ic),op) &&