* src/SDCCdflow.c (computeDataFlow): Fixed bug #810746
authorepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 26 Sep 2003 08:03:12 +0000 (08:03 +0000)
committerepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 26 Sep 2003 08:03:12 +0000 (08:03 +0000)
* src/asm.c (printILine): Fixed bug #811015

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

ChangeLog
src/SDCCdflow.c
src/asm.c

index 3e85cc2dc648d4423918c7d9837d6c69807f589f..161e0edede9f24adf5776c48966debc93c88aaae 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-09-26  Erik Petrich <epetrich@ivorytower.norman.ok.us>
+
+       * src/SDCCdflow.c (computeDataFlow): Fixed bug #810746
+       * src/asm.c (printILine): Fixed bug #811015
+
 2003-09-22  Jesus Calvino-Fraga <jesusc@ece.ubc.ca>
 
        *link/z80/lklibr.c, as/mcs51/lklibr.c: Improved memory allocation and
 2003-09-22  Jesus Calvino-Fraga <jesusc@ece.ubc.ca>
 
        *link/z80/lklibr.c, as/mcs51/lklibr.c: Improved memory allocation and
index 4c298fe4269c68b8842d8486e896ae6933ff99bd..b76055e500ebb5c6fcc100f358b8d173a17f5436 100644 (file)
@@ -151,6 +151,7 @@ DEFSETFUNC (mergeInDefs)
 
 }
 
 
 }
 
+
 /*-----------------------------------------------------------------*/
 /* computeDataFlow - does computations for data flow accross blocks */
 /*-----------------------------------------------------------------*/
 /*-----------------------------------------------------------------*/
 /* computeDataFlow - does computations for data flow accross blocks */
 /*-----------------------------------------------------------------*/
@@ -170,7 +171,8 @@ computeDataFlow (eBBlock ** ebbs, int count)
        {
 
          set *pred;
        {
 
          set *pred;
-         set *oldOut;
+         set *oldOutExprs = NULL;
+          bitVect *oldOutDefs = NULL;
          int firstTime;
          eBBlock *pBlock;
 
          int firstTime;
          eBBlock *pBlock;
 
@@ -182,9 +184,12 @@ computeDataFlow (eBBlock ** ebbs, int count)
          /* get blocks that can come to this block */
          pred = edgesTo (ebbs[i]);
 
          /* get blocks that can come to this block */
          pred = edgesTo (ebbs[i]);
 
-         /* make a copy of the outExpressions : to be */
+         /* make a copy of the outExpressions or outDefs : to be */
          /* used for iteration   */
          /* used for iteration   */
-         oldOut = setFromSet (ebbs[i]->outExprs);
+         if (optimize.global_cse)
+           oldOutExprs = setFromSet (ebbs[i]->outExprs);
+         else
+           oldOutDefs = bitVectCopy (ebbs[i]->outDefs);
          setToNull ((void **) &ebbs[i]->inDefs);
 
          /* indefitions are easy just merge them by union */
          setToNull ((void **) &ebbs[i]->inDefs);
 
          /* indefitions are easy just merge them by union */
@@ -226,7 +231,10 @@ computeDataFlow (eBBlock ** ebbs, int count)
          cseBBlock (ebbs[i], TRUE, ebbs, count);
 
          /* if it change we will need to iterate */
          cseBBlock (ebbs[i], TRUE, ebbs, count);
 
          /* if it change we will need to iterate */
-         change += !isSetsEqualWith (ebbs[i]->outExprs, oldOut, isCseDefEqual);
+         if (optimize.global_cse)
+           change += !isSetsEqualWith (ebbs[i]->outExprs, oldOutExprs, isCseDefEqual);
+         else
+           change += !bitVectEqual (ebbs[i]->outDefs, oldOutDefs);
        }
 
       if (!change)             /* iterate till no change */
        }
 
       if (!change)             /* iterate till no change */
index 1ab5c5275e169fb8296d0fb85216eadc8dd70684..d4860c284ab40a8ac4253866a9c12d31b1366db2 100644 (file)
--- a/src/asm.c
+++ b/src/asm.c
@@ -280,7 +280,10 @@ char *printILine (iCode *ic) {
 
   // stuff the pipe with the readable icode
   pipeStream=fdopen(filedes[1],"w");
 
   // stuff the pipe with the readable icode
   pipeStream=fdopen(filedes[1],"w");
-  icTab->iCodePrint(pipeStream, ic, icTab->printName);
+  if (ic->op != INLINEASM)
+    icTab->iCodePrint(pipeStream, ic, icTab->printName);
+  else
+    fprintf(pipeStream, "inline\n");
   // it really needs an extra push
   fflush(pipeStream);
   // now swallow it
   // it really needs an extra push
   fflush(pipeStream);
   // now swallow it