From: kvigor Date: Fri, 26 Jan 2001 17:07:57 +0000 (+0000) Subject: fix on-demand integer promotion X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=4dfb046a42588a921ff6e690691609227a24dce1;p=fw%2Fsdcc fix on-demand integer promotion git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@538 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/SDCCast.c b/src/SDCCast.c index 98a86ac8..c109a873 100644 --- a/src/SDCCast.c +++ b/src/SDCCast.c @@ -1527,9 +1527,9 @@ void pushTypeCastToLeaves(sym_link *type, ast *node, ast **parentPtr) /* We're at a leaf; if it's a value, apply the typecast */ if (node->type == EX_VALUE && IS_INTEGRAL(TTYPE(node))) { - *parentPtr = newNode(CAST, - newAst_LINK(copyLinkChain(type)), - node); + *parentPtr = decorateType(newNode(CAST, + newAst_LINK(copyLinkChain(type)), + node)); } } else @@ -1562,7 +1562,7 @@ void propAsgType(ast *tree) return; } - if (getSize(LTYPE(tree)) != getSize(RTYPE(tree))) + if (getSize(LTYPE(tree)) > getSize(RTYPE(tree))) { pushTypeCastToLeaves(LTYPE(tree), tree->right, &(tree->right)); } @@ -2756,7 +2756,6 @@ ast *decorateType (ast *tree) tree->right)); } } - pushTypeCastToLeaves(currFunc->type->next, tree->right, &(tree->right)); RRVAL(tree) = 1; return tree;