followup for the bug #460088 fix
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 5 Apr 2003 16:53:11 +0000 (16:53 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 5 Apr 2003 16:53:11 +0000 (16:53 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2485 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCcse.c
src/SDCCloop.c

index ea64e30c70d5ce77e09ed2c851273144d20826c3..8942590efaa793ca29e633f76590d7e36fadaa51 100644 (file)
@@ -1541,9 +1541,9 @@ cseBBlock (eBBlock * ebb, int computeOnly,
                          aggrToPtr (operandType (IC_RESULT (ic)), FALSE));
        }
 
-      /* if this is a condition statment then */
+      /* if this is a condition statement then */
       /* check if the condition can be replaced */
-      if (!computeOnly && ic->op == IFX)
+      if (ic->op == IFX)
        {
          ifxOptimize (ic, cseSet, computeOnly,
                       ebb, &change,
@@ -1631,7 +1631,7 @@ cseBBlock (eBBlock * ebb, int computeOnly,
        }
        
       /* if left or right changed then do algebraic */
-      if (change)
+      if (!computeOnly && change)
        {
          algebraicOpts (ic);
          while (constFold (ic, cseSet));
index f43e48373dcb31f3d42fb12b71aae3101e9177f4..d04b717c2c759dafc3514958d14c7f74312360a0 100644 (file)
@@ -307,7 +307,7 @@ DEFSETFUNC (addDefInExprs)
   V_ARG (int, count);
 
   addSetHead (&ebp->inExprs, cdp);
-  cseBBlock (ebp, 0, ebbs, count);
+  cseBBlock (ebp, optimize.global_cse, ebbs, count);
   return 0;
 }