* src/SDCCcse.c (cseBBlock): retain assignment to self when volatile
authorepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 16 Mar 2005 06:20:13 +0000 (06:20 +0000)
committerepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 16 Mar 2005 06:20:13 +0000 (06:20 +0000)
* src/SDCCast.c (isLoopCountable): fixed bug #1161985

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3697 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/SDCCast.c
src/SDCCcse.c

index 9f4e7af7351a9936e493f6c6392bf8cc35e9a7df..827acfade3e7fdad1c5d85625a8064efabe93ad1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-03-16 Erik Petrich <epetrich AT ivorytower.norman.ok.us>
+
+       * src/SDCCcse.c (cseBBlock): retain assignment to self when volatile
+       * src/SDCCast.c (isLoopCountable): fixed bug #1161985
+
 2005-03-15 Maarten Brock <sourceforge.brock AT dse.nl>
 
        * device/lib/printf_large.c: removed inline assembly for portability and
index f872f88c25fcb58d6b34ce0c6a191e919c118639..e0ea695aa30a690521125f9daafa64620a3073de 100644 (file)
@@ -1533,6 +1533,8 @@ isLoopCountable (ast * initExpr, ast * condExpr, ast * loopExpr,
         }
 
     }
+  else
+    return FALSE;
 
   /* check loop expression is of the form <sym>++ */
   if (!IS_AST_OP (loopExpr))
index 1e07bb45572b067f83df969f7e56c90abfd3f9de..05c6e2e6ca5fa892d86a3accdec7452e07848938 100644 (file)
@@ -2057,7 +2057,7 @@ cseBBlock (eBBlock * ebb, int computeOnly,
 
       /* if after all this it becomes an assignment to self
          then delete it and continue */
-      if (ASSIGNMENT_TO_SELF (ic))
+      if (ASSIGNMENT_TO_SELF (ic) && !isOperandVolatile (IC_RIGHT(ic), FALSE))
         {
           remiCodeFromeBBlock (ebb, ic);
           continue;