Bit-field patch to predict.c

Joseph S. Myers jsm@polyomino.org.uk
Wed Dec 17 19:25:00 GMT 2003


The following simple patch arose as part of resurrecting the bit-field
patch, but doesn't depend on the rest of that patch.  Bit-fields of
width 1 should be unsigned int, as signed ones can only hold 0 and -1
(not 0 and 1); various similar corrections were made previously, as
with the bit-field patch warnings arise for assigning 1 to such a
bit-field (as requested in PR c/2511).

Bootstrapped with no regressions on i686-pc-linux-gnu.  OK to commit?

2003-12-17  Joseph S. Myers  <jsm@polyomino.org.uk>

	* predict.c (struct block_info_def, struct edge_info_def): Change
	bit-fields of width 1 to unsigned int.

--- GCC.orig/gcc/predict.c	2003-10-04 07:30:42.000000000 +0000
+++ GCC/gcc/predict.c	2003-11-29 20:41:32.000000000 +0000
@@ -879,7 +879,7 @@
   basic_block next;
 
   /* True if block needs to be visited in propagate_freq.  */
-  int tovisit:1;
+  unsigned int tovisit:1;
 
   /* Number of predecessors we need to visit first.  */
   int npredecessors;
@@ -893,7 +893,7 @@
      then computed as 1 / (1 - back_edge_prob).  */
   sreal back_edge_prob;
   /* True if the edge is an loopback edge in the natural loop.  */
-  int back_edge:1;
+  unsigned int back_edge:1;
 } *edge_info;
 
 #define BLOCK_INFO(B)	((block_info) (B)->aux)

-- 
Joseph S. Myers
jsm@polyomino.org.uk



More information about the Gcc-patches mailing list