This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Making Java work again


The following are needed to update Java to work with the sizetype
changes (and not even the most recent batch!).  I commmitted them.

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.
	* java/decl.c (init_decl_processing): Call initialize_sizetypes once.
	Adjust order of making types.
	Make bitsize_*_node values.

*** stor-layout.c	2000/03/25 18:34:05	1.60
--- stor-layout.c	2000/03/26 18:46:41
*************** layout_type (type)
*** 1428,1435 ****
       record it so set_sizetype can fix it up.  */
    if (! sizetype_set)
!     {
!       TREE_CHAIN (type) = early_type_list;
!       early_type_list = type;
!     }
  }
  
--- 1428,1432 ----
       record it so set_sizetype can fix it up.  */
    if (! sizetype_set)
!     early_type_list = tree_cons (NULL_TREE, type, early_type_list);
  }
  
*************** set_sizetype (type)
*** 1509,1513 ****
  		       2 * HOST_BITS_PER_WIDE_INT);
    unsigned int i;
!   tree t, next;
  
    if (sizetype_set)
--- 1506,1510 ----
  		       2 * HOST_BITS_PER_WIDE_INT);
    unsigned int i;
!   tree t;
  
    if (sizetype_set)
*************** set_sizetype (type)
*** 1562,1575 ****
    /* 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)
      {
!       next = TREE_CHAIN (t);
!       TREE_CHAIN (t) = 0;
! 
!       if (TREE_CODE (t) != INTEGER_TYPE)
  	abort ();
  
!       TREE_TYPE (TYPE_SIZE (t)) = bitsizetype;
!       TREE_TYPE (TYPE_SIZE_UNIT (t)) = sizetype;
      }
  
--- 1559,1569 ----
    /* 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 = TREE_CHAIN (t))
      {
!       if (TREE_CODE (TREE_VALUE (t)) != INTEGER_TYPE)
  	abort ();
  
!       TREE_TYPE (TYPE_SIZE (TREE_VALUE (t))) = bitsizetype;
!       TREE_TYPE (TYPE_SIZE_UNIT (TREE_VALUE (t))) = sizetype;
      }
  
*** tree.c	2000/03/25 18:34:05	1.131
--- tree.c	2000/03/26 18:46:59
*************** tree_cons (purpose, value, chain)
*** 2172,2177 ****
  
  #ifdef GATHER_STATISTICS
!   tree_node_counts[(int)x_kind]++;
!   tree_node_sizes[(int)x_kind] += sizeof (struct tree_list);
  #endif
  
--- 2172,2177 ----
  
  #ifdef GATHER_STATISTICS
!   tree_node_counts[(int) x_kind]++;
!   tree_node_sizes[(int) x_kind] += sizeof (struct tree_list);
  #endif
  
*************** build_common_tree_nodes_2 (short_double)
*** 5710,5716 ****
    /* 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);
--- 5710,5714 ----
*** java/decl.c	2000/03/17 17:31:57	1.58
--- java/decl.c	2000/03/26 18:47:06
*************** init_decl_processing ()
*** 458,472 ****
    global_binding_level = current_binding_level;
  
    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);
--- 458,468 ----
    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;
  
    /* Create sizetype first - needed for other types. */
    initialize_sizetypes ();
  
    byte_type_node = make_signed_type (8);
*************** init_decl_processing ()
*** 492,497 ****
  			unsigned_long_type_node));
  
!   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);
--- 488,495 ----
  			unsigned_long_type_node));
  
!   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);
*************** init_decl_processing ()
*** 499,502 ****
--- 497,506 ----
    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);
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]