16-bit codes

Mike Stump mrs@apple.com
Mon Mar 26 21:26:00 GMT 2007


We've seem to have stabilized on this solution.

Almost the same as Doug's original version, but I hoisted up the
MAX_TREE_CODES and replaced the hard 512s with it.

Ok?

2007-03-26  Douglas Gregor  <doug.gregor@gmail.com>

	* tree.c (tree_contains_struct): Permit 512 tree codes.
	* tree.h (tree_contains_struct): Ditto.
	(MAX_TREE_CODES): Ditto.
	(struct tree_base): Make CODE 16 bits, instead of 8 bits. Add
	SPARE member to store remaining padding bits.

Doing diffs in .:
--- ./tree.c.~1~	2007-03-20 19:07:00.000000000 -0700
+++ ./tree.c	2007-03-26 11:23:42.000000000 -0700
@@ -168,7 +168,7 @@ static unsigned int attribute_hash_list 
 tree global_trees[TI_MAX];
 tree integer_types[itk_none];
 
-unsigned char tree_contains_struct[256][64];
+unsigned char tree_contains_struct[MAX_TREE_CODES][64];
 
 /* Number of operands for each OpenMP clause.  */
 unsigned const char omp_clause_num_ops[] =
--- ./tree.h.~1~	2007-03-20 19:07:00.000000000 -0700
+++ ./tree.h	2007-03-26 11:34:21.000000000 -0700
@@ -41,7 +41,8 @@ enum tree_code {
 
 #undef DEFTREECODE
 
-extern unsigned char tree_contains_struct[256][64];
+#define MAX_TREE_CODES 512
+extern unsigned char tree_contains_struct[MAX_TREE_CODES][64];
 #define CODE_CONTAINS_STRUCT(CODE, STRUCT) (tree_contains_struct[(CODE)][(STRUCT)])
 
 /* Number of language-independent tree codes.  */
@@ -80,7 +81,6 @@ extern const char *const tree_code_class
 #define TREE_CODE_CLASS_STRING(CLASS)\
         tree_code_class_strings[(int) (CLASS)]
 
-#define MAX_TREE_CODES 256
 extern const enum tree_code_class tree_code_type[];
 #define TREE_CODE_CLASS(CODE)	tree_code_type[(int) (CODE)]
 
@@ -363,7 +363,7 @@ union tree_ann_d;
 
 struct tree_base GTY(())
 {
-  ENUM_BITFIELD(tree_code) code : 8;
+  ENUM_BITFIELD(tree_code) code : 16;
 
   unsigned side_effects_flag : 1;
   unsigned constant_flag : 1;
@@ -392,6 +392,8 @@ struct tree_base GTY(())
   unsigned lang_flag_6 : 1;
   unsigned visited : 1;
 
+  unsigned spare : 24;
+
   /* FIXME tuples: Eventually, we need to move this somewhere external to
      the trees.  */
   union tree_ann_d *ann;
--------------



More information about the Gcc-patches mailing list