* src/SDCCcse.c (cseBBlock): retain assignment to self when volatile
[fw/sdcc] / src / SDCCcse.c
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;