OSDN Git Service

* stor-layout.c (layout_type, set_sizetype): early_type_list is
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 26 Mar 2000 19:01:55 +0000 (19:01 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 26 Mar 2000 19:01:55 +0000 (19:01 +0000)
now a list of TREE_LIST entries, not types.
* tree.c (build_common_tree_nodes_2): Eliminate dupliate type sets.
* java/decl.c (init_decl_processing): Call initialize_sizetypes once.
Adjust order of making types.
Make bitsize_*_node values.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32751 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/java/ChangeLog
gcc/java/decl.c
gcc/stor-layout.c
gcc/tree.c

index e7331e7..83ddf36 100644 (file)
@@ -1,5 +1,9 @@
 Sun Mar 26 11:37:55 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
 
+       * stor-layout.c (layout_type, set_sizetype): early_type_list is
+       now a list of TREE_LIST entries, not types.
+       * tree.c (build_common_tree_nodes_2): Eliminate dupliate type sets.
+
        * expmed.c (extract_bit_field): Ensure BITS_PER_WORD is signed in MAX.
        * config/arm/pe.c (arm_pe_return_in_memory): Use host_integerp and
        int_bit_position.
index 1584a80..cfdeb1f 100644 (file)
@@ -1,3 +1,9 @@
+Sun Mar 26 11:37:55 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
+
+       * decl.c (init_decl_processing): Only call initialize_sizetypes once.
+       Adjust order of making types.
+       Make bitsize_*_node values.
+
 Sat Mar 25 09:12:10 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
 
        * class.c (make_field_value): Use byte_position.
index f5cd80e..ebe591d 100644 (file)
@@ -457,17 +457,13 @@ init_decl_processing ()
   pushlevel (0);       /* make the binding_level structure for global names */
   global_binding_level = current_binding_level;
 
+  /* The code here must be similar to build_common_tree_nodes{,_2} in
+     tree.c, especially as to the order of initializing common nodes.  */
   error_mark_node = make_node (ERROR_MARK);
   TREE_TYPE (error_mark_node) = error_mark_node;
 
-  initialize_sizetypes ();
   /* Create sizetype first - needed for other types. */
   initialize_sizetypes ();
-  set_sizetype (make_unsigned_type (POINTER_SIZE));
-  size_zero_node = build_int_2 (0, 0);
-  TREE_TYPE (size_zero_node) = sizetype;
-  size_one_node = build_int_2 (1, 0);
-  TREE_TYPE (size_one_node) = sizetype;
 
   byte_type_node = make_signed_type (8);
   pushdecl (build_decl (TYPE_DECL, get_identifier ("byte"), byte_type_node));
@@ -491,14 +487,22 @@ init_decl_processing ()
   pushdecl (build_decl (TYPE_DECL, get_identifier ("unsigned long"),
                        unsigned_long_type_node));
 
-  integer_type_node = type_for_size (INT_TYPE_SIZE, 0);
+  set_sizetype (make_unsigned_type (POINTER_SIZE));
 
+  /* Define these next since types below may used them.  */
+  integer_type_node = type_for_size (INT_TYPE_SIZE, 0);
   integer_zero_node = build_int_2 (0, 0);
   integer_one_node = build_int_2 (1, 0);
   integer_two_node = build_int_2 (2, 0);
   integer_four_node = build_int_2 (4, 0);
   integer_negative_one_node = build_int_2 (-1, 0);
 
+  size_zero_node = size_int (0);
+  size_one_node = size_int (1);
+  bitsize_zero_node = bitsize_int (0);
+  bitsize_one_node = bitsize_int (1);
+  bitsize_unit_node = bitsize_int (BITS_PER_UNIT);
+
   long_zero_node = build_int_2 (0, 0);
   TREE_TYPE (long_zero_node) = long_type_node;
 
index ada43a0..58ab3f5 100644 (file)
@@ -1427,10 +1427,7 @@ layout_type (type)
   /* If this type is created before sizetype has been permanently set,
      record it so set_sizetype can fix it up.  */
   if (! sizetype_set)
-    {
-      TREE_CHAIN (type) = early_type_list;
-      early_type_list = type;
-    }
+    early_type_list = tree_cons (NULL_TREE, type, early_type_list);
 }
 \f
 /* Create and return a type for signed integers of PRECISION bits.  */
@@ -1508,7 +1505,7 @@ set_sizetype (type)
   int precision = MIN (oprecision + BITS_PER_UNIT_LOG + 1,
                       2 * HOST_BITS_PER_WIDE_INT);
   unsigned int i;
-  tree t, next;
+  tree t;
 
   if (sizetype_set)
     abort ();
@@ -1561,16 +1558,13 @@ set_sizetype (type)
 
   /* Go down each of the types we already made and set the proper type
      for the sizes in them.  */
-  for (t = early_type_list; t != 0; t = next)
+  for (t = early_type_list; t != 0; t = TREE_CHAIN (t))
     {
-      next = TREE_CHAIN (t);
-      TREE_CHAIN (t) = 0;
-
-      if (TREE_CODE (t) != INTEGER_TYPE)
+      if (TREE_CODE (TREE_VALUE (t)) != INTEGER_TYPE)
        abort ();
 
-      TREE_TYPE (TYPE_SIZE (t)) = bitsizetype;
-      TREE_TYPE (TYPE_SIZE_UNIT (t)) = sizetype;
+      TREE_TYPE (TYPE_SIZE (TREE_VALUE (t))) = bitsizetype;
+      TREE_TYPE (TYPE_SIZE_UNIT (TREE_VALUE (t))) = sizetype;
     }
 
   early_type_list = 0;
index 1e21225..381d5f0 100644 (file)
@@ -2171,8 +2171,8 @@ tree_cons (purpose, value, chain)
     }
 
 #ifdef GATHER_STATISTICS
-  tree_node_counts[(int)x_kind]++;
-  tree_node_sizes[(int)x_kind] += sizeof (struct tree_list);
+  tree_node_counts[(int) x_kind]++;
+  tree_node_sizes[(int) x_kind] += sizeof (struct tree_list);
 #endif
 
   TREE_SET_CODE (node, TREE_LIST);
@@ -5709,9 +5709,7 @@ build_common_tree_nodes_2 (short_double)
 {
   /* Define these next since types below may used them.  */
   integer_zero_node = build_int_2 (0, 0);
-  TREE_TYPE (integer_zero_node) = integer_type_node;
   integer_one_node = build_int_2 (1, 0);
-  TREE_TYPE (integer_one_node) = integer_type_node;
 
   size_zero_node = size_int (0);
   size_one_node = size_int (1);