* src/SDCCast.c (isConformingBody): fixed bug #949967
authorepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 19 May 2004 06:27:20 +0000 (06:27 +0000)
committerepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 19 May 2004 06:27:20 +0000 (06:27 +0000)
* 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

ChangeLog
src/SDCCast.c
src/SDCCopt.c

index 8caad087de94e65d24cd8cc466c7e76f7863df52..f1cd2ef04ab9a9151f7e346ede4e7a5f23bafc6d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-05-19 Erik Petrich <epetrich AT ivorytower.norman.ok.us>
+
+       * src/SDCCast.c (isConformingBody): fixed bug #949967
+       * src/SDCCopt.c (cnvToFcall, cnvToFloatCast, cnvFromFloatCast,
+       convilong): fixed bug #952086
+
 2004-05-18 Erik Petrich <epetrich AT ivorytower.norman.ok.us>
 
        * src/SDCCmem.c (allocVariables): fixed bug #955321
index a3fb39df8e7048a02e769ec735c62fcdc83885d9..ef2f29a7687986651c72604491c1c88b095c26ad 100644 (file)
@@ -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:
index 93668913bfebe1ee4448c2ae94ea30d6001c9bb2..e76e30f39cd97ae71a17c880b6970b9eb28030d3 100644 (file)
@@ -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