[gcc-in-cxx] FYI: don't use enum for masks

Tom Tromey tromey@redhat.com
Fri Sep 19 22:33:00 GMT 2008


I'm checking this in on the gcc-in-cxx.

This changes the types of a couple of fields from an enum to an
unsigned int.  These fields hold or'd combinations of enum values, and
so should not have enum type.

This fixes a number of compilation errors.

Tom

ChangeLog:
2008-09-19  Tom Tromey  <tromey@redhat.com>

	* tree-flow.h (struct ptr_info_def) <escape_mask>: Now unsigned
	int.
	(struct var_ann_d) <escape_mask>: Likewise.

Index: tree-flow.h
===================================================================
--- tree-flow.h	(revision 140371)
+++ tree-flow.h	(working copy)
@@ -231,8 +231,10 @@
 /* Aliasing information for SSA_NAMEs representing pointer variables.  */
 struct ptr_info_def GTY(())
 {
-  /* Mask of reasons this pointer's value escapes the function.  */
-  ENUM_BITFIELD (escape_type) escape_mask : 9;
+  /* Mask of reasons this pointer's value escapes the function.  This
+     actually holds enum escape_type values, or'd together.  So, it
+     must be wide enough to hold all values from the enum.  */
+  unsigned int escape_mask : 9;
 
   /* Nonzero if points-to analysis couldn't determine where this pointer
      is pointing to.  */
@@ -380,8 +382,10 @@
   ENUM_BITFIELD (noalias_state) noalias_state : 2;
 
   /* Mask of values saying the reasons why this variable has escaped
-     the function.  */
-  ENUM_BITFIELD (escape_type) escape_mask : 9;
+     the function.  This actually holds enum escape_type values, or'd
+     together.  So, it must be wide enough to hold all values from the
+     enum.  */
+  unsigned int escape_mask : 9;
 
   /* Memory partition tag assigned to this symbol.  */
   tree mpt;



More information about the Gcc-patches mailing list