From: epetrich Date: Wed, 19 May 2004 06:27:20 +0000 (+0000) Subject: * src/SDCCast.c (isConformingBody): fixed bug #949967 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=30249085d67be1d695ad91e97ad2f571352fed36;p=fw%2Fsdcc * src/SDCCast.c (isConformingBody): fixed bug #949967 * src/SDCCopt.c (cnvToFcall, cnvToFloatCast, cnvFromFloatCast, convilong): fixed bug #952086 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3320 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index 8caad087..f1cd2ef0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-05-19 Erik Petrich + + * src/SDCCast.c (isConformingBody): fixed bug #949967 + * src/SDCCopt.c (cnvToFcall, cnvToFloatCast, cnvFromFloatCast, + convilong): fixed bug #952086 + 2004-05-18 Erik Petrich * src/SDCCmem.c (allocVariables): fixed bug #955321 diff --git a/src/SDCCast.c b/src/SDCCast.c index a3fb39df..ef2f29a7 100644 --- a/src/SDCCast.c +++ b/src/SDCCast.c @@ -1655,10 +1655,12 @@ isConformingBody (ast * pbody, symbol * sym, ast * body) /*------------------------------------------------------------------*/ case '[': // if the loopvar is used as an index - if (astHasSymbol(pbody->right, sym)) { + /* array op is commutative -- must check both left & right */ + if (astHasSymbol(pbody->right, sym) || astHasSymbol(pbody->left, sym)) { return FALSE; } - return isConformingBody (pbody->right, sym, body); + return isConformingBody (pbody->right, sym, body) + && isConformingBody (pbody->left, sym, body); /*------------------------------------------------------------------*/ case PTR_OP: diff --git a/src/SDCCopt.c b/src/SDCCopt.c index 93668913..e76e30f3 100644 --- a/src/SDCCopt.c +++ b/src/SDCCopt.c @@ -176,7 +176,10 @@ cnvToFcall (iCode * ic, eBBlock * ebp) IC_RESULT (newic) = IC_RESULT (ic); newic->lineno = lineno; newic->parmBytes+=bytesPushed; - + ebp->hasFcall = 1; + if (currFunc) + FUNC_HASFCALL (currFunc->type) = 1; + if(TARGET_IS_PIC16) { /* normally these functions aren't marked external, so we can use their * _extern field to marked as already added to symbol table */ @@ -264,6 +267,9 @@ found: newic = newiCode (CALL, operandFromSymbol (func), NULL); IC_RESULT (newic) = IC_RESULT (ic); newic->parmBytes+=bytesPushed; + ebp->hasFcall = 1; + if (currFunc) + FUNC_HASFCALL (currFunc->type) = 1; if(TARGET_IS_PIC16) { /* normally these functions aren't marked external, so we can use their @@ -354,6 +360,9 @@ found: newic = newiCode (CALL, operandFromSymbol (func), NULL); IC_RESULT (newic) = IC_RESULT (ic); newic->parmBytes+=bytesPushed; + ebp->hasFcall = 1; + if (currFunc) + FUNC_HASFCALL (currFunc->type) = 1; if(TARGET_IS_PIC16) { /* normally these functions aren't marked external, so we can use their @@ -517,6 +526,9 @@ found: IC_RESULT (newic) = IC_RESULT (ic); newic->lineno = lineno; newic->parmBytes+=bytesPushed; // to clear the stack after the call + ebp->hasFcall = 1; + if (currFunc) + FUNC_HASFCALL (currFunc->type) = 1; if(TARGET_IS_PIC16) { /* normally these functions aren't marked external, so we can use their