From: johanknol Date: Sun, 27 Jan 2002 10:02:22 +0000 (+0000) Subject: fixed an integral promotion bug X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=99419f4aa880e9b20ecced49fe093395d79be88b;p=fw%2Fsdcc fixed an integral promotion bug git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1843 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/ds390/ralloc.c b/src/ds390/ralloc.c index d91d0a35..d731417d 100644 --- a/src/ds390/ralloc.c +++ b/src/ds390/ralloc.c @@ -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) &&