Can you tell me what they are?

H.J. Lu hjl@varesearch.com
Thu Mar 4 10:06:00 GMT 1999


> 
> 
>   In message < m10HtC8-000AUZC@shanghai.varesearch.com >you write:
>   > I don't think all the changes were deleted. At least, print-rtl.c still
>   > includes basic-block.h and flow.c still includes insn-flags.h. Here is
>   > a patch for Makefile.in.
> Thanks.  This should be fixed now.
> 

But why doesn't print-rtl.o depend on $(BASIC_BLOCK_H)?

> 
>   > BTW, the current egcs in CVS still fails "make check" with the libg++
>   > addon under Linux/x86/glibc2.
> Send richard a complete testcase.
> 

This patch seems to fix my libg++ problem.

Thanks.

-- 
H.J. Lu (hjl@gnu.org)
---
Wed Mar  3 16:14:54 1999  H.J. Lu  (hjl@gnu.org)

	* flow.c (delete_unreachable_blocks): Check duplications on
	worklist.

Index: flow.c
===================================================================
RCS file: /local/work/cvs/gnu/egcs/gcc/flow.c,v
retrieving revision 1.1.1.55
diff -u -p -r1.1.1.55 flow.c
--- flow.c	1999/03/01 22:41:26	1.1.1.55
+++ flow.c	1999/03/03 20:00:00
@@ -1451,7 +1451,7 @@ delete_unreachable_blocks ()
   basic_block *worklist, *tos;
   int deleted_handler;
   edge e;
-  int i, n;
+  int i, n, n_tos;
 
   n = n_basic_blocks;
   tos = worklist = (basic_block *) alloca (sizeof (basic_block) * n);
@@ -1465,21 +1465,37 @@ delete_unreachable_blocks ()
      be only one.  It isn't inconcievable that we might one day directly
      support Fortran alternate entry points.  */
 
+  n_tos = 0;
   for (e = ENTRY_BLOCK_PTR->succ; e ; e = e->succ_next)
-    *tos++ = e->dest;
-      
+    {
+      *tos++ = e->dest;
+      n_tos++;
+    }
+
   /* Iterate: find everything reachable from what we've already seen.  */
 
   while (tos != worklist)
     {
       basic_block b = *--tos;
+      n_tos--;
 
       /* Mark the block with a handy non-null value.  */
       b->aux = b;
 
       for (e = b->succ; e ; e = e->succ_next)
 	if (!e->dest->aux)
-	  *tos++ = e->dest;
+	  {
+	    /* We have to check the duplications. Otherwise, we may
+	       just override something on the stack. */
+	    for (i = 0; i < n_tos; i++)
+	      if (worklist [i] == e->dest)
+		break;
+	    if (i >= n_tos)
+	      {
+		*tos++ = e->dest;
+		n_tos++;
+	      }
+	  }
     }
 
   /* Delete all unreachable basic blocks.  Count down so that we don't


More information about the Gcc mailing list