Bug in cprop

Bernd Schmidt crux@pool.informatik.rwth-aachen.de
Fri Apr 16 10:50:00 GMT 1999


There is a bug in gcse.c which was introduced when
compute_cprop_local_properties was abandoned in favor of
compute_local_properties.  compute_cprop_local_properties computed the
cprop_absaltered vector by first clearing it, and then letting
compute_transp set the approppriate bits.  Now, in compute_local_properties,
the vector (which is passed as argument TRANSP) is initialized to all ones,
and bits are only set in it, never reset.
The patch below corrects this bug.

This patch (together with another gcse patch I'll send later) bootstrapped
with Monday's CVS source on i586-linux.

Bernd

	* gcse.c (compute_local_properties): If setp is nonzero, clear
	TRANSP instead of setting it to all ones.

Index: gcc/gcse.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/gcse.c,v
retrieving revision 1.35
diff -u -p -r1.35 gcse.c
--- gcse.c	1999/03/31 12:40:56	1.35
+++ gcse.c	1999/04/14 17:04:03
@@ -941,7 +948,12 @@ compute_local_properties (transp, comp, 
   
   /* Initialize any bitmaps that were passed in.  */
   if (transp)
-    sbitmap_vector_ones (transp, n_basic_blocks);
+    {
+      if (setp)
+	sbitmap_vector_zero (transp, n_basic_blocks);
+      else
+	sbitmap_vector_ones (transp, n_basic_blocks);
+    }
   if (comp)
     sbitmap_vector_zero (comp, n_basic_blocks);
   if (antloc)



More information about the Gcc-patches mailing list