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]
Other format: [Raw text]

Add checks for tree.value, tree.minval, and tree.maxval and others


The three named fields above are used in different ways in different tree
nodes and have different access macros for each use.  But nothing checks
that they aren't being used inappropriately, and in some cases they are.

This long patch cleans up that issue, but has no functional change.

java/java-tree.h has cleanups throughout, both whitespace and adding calls
to checking functions.  I'd originally tried to tighten some of the checks
even more, but found the comments don't match the code. There may well
be some latent bugs here.

In the .c files, the only significant change is to type_hash_eq in tree.c,
to cause it to always use the proper field name.  I'm aware that this function
is only called for a small fraction of the types, but it's easier to have it
handle all than document the subset its called for.

Tested on x86-64-linux.

Thu Mar 18 13:20:13 2004  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
	
	* tree.h (TREE_CHECK2, TREE_CHECK3, TREE_CHECK5): New macros.
	(tree_check2_failed, tree_check3_failed, tree_check5_failed): New decl.
	(FUNC_OR_METHOD_CHECK, SET_ARRAY_OR_VECTOR_CHECK): New macros.
	(REC_OR_UNION_CHECK, NUMERICAL_TYPE_CHECK): Likewise.
	(TYPE_VALUES, TYPE_DOMAIN, TYPE_FIELDS, TYPE_METHODS, TYPE_VFIELD):
	Protect with proper check.
	(TYPE_ARG_TYPES, TYPE_METHOD_BASETYPE, TYPE_OFFSET_BASETYPE): Likewise.
	(TYPE_MIN_VALUE, TYPE_MAX_VALUE): Likewise.
	* tree.c (type_hash_eq): Rewrite to access proper fields for each type.
	(tree_check2_failed, tree_check3_failed, tree_check5_failed): New.
	* c-typeck.c (build_array_ref): Use TYPE_DOMAIN, not TYPE_VALUES.
	* dwarf2out.c (gen_enumeration_type_die): Use TYPE_VALUES,
	not TYPE_FIELDS.

	* cp/class.c (finish_struct_bits): Use TYPE_VFIELD and TYPE_METHODS.
	* cp/error.c (dump_type): Use TYPEOF_TYPE_EXPR.
	* cp/pt.c (tsubst): Likewise.
	* cp/semantics.c (finish_typeof): Likewise.
	* cp/search.c (dfs_unuse_fields): Handle TYPENAME_TYPE, TYPEOF_TYPE,
	and TEMPLATE_TYPE_PARM.
	* cp/typeck.c (comptypes): Use TYPE_ORIG_SIZE_TYPE, not TYPE_DOMAIN.
	(build_array_ref): Use TYPE_DOMAIN, not TYPE_VALUES.

	* java/java-tree.h: Changes throughout to add checking to macros
	and numerous whitespace changes.
	(VAR_OR_FIELD_CHECK): New macro.
	* java/jcf-write.c (get_access_flags): Use FIELD_PUBLIC, METHOD_PUBLIC,
	FIELD_FINAL, and METHOD_FINAL instead of CLASS_PUBLIC and CLASS_FINAL.

	* ada/ada-tree.h (TYPE_LEFT_JUSTIFIED_MODULAR_P): Add checking.
	(TYPE_CONTAINS_TEMPLATE_P, TYPE_OBJECT_RECORD_TYPE): Likewise.
	(TYPE_RM_SIZE_INT): Directly use type.values.
	(TREE_LOOP_ID): Clean up check.
	* ada/decl.c (gnat_to_gnu_entity, case E_Enumeration_Type): Use
	TYPE_VALUES, not TYPE_FIELDS.
	* ada/trans.c (convert_with_check): Delay access of bounds of basetype
	until sure is numeric.

*** c-typeck.c	16 Mar 2004 20:37:14 -0000	1.288
--- c-typeck.c	18 Mar 2004 03:38:51 -0000
*************** build_array_ref (tree array, tree index)
*** 1511,1516 ****
  	 to access a non-existent part of the register.  */
        if (TREE_CODE (index) == INTEGER_CST
! 	  && TYPE_VALUES (TREE_TYPE (array))
! 	  && ! int_fits_type_p (index, TYPE_VALUES (TREE_TYPE (array))))
  	{
  	  if (!c_mark_addressable (array))
--- 1511,1516 ----
  	 to access a non-existent part of the register.  */
        if (TREE_CODE (index) == INTEGER_CST
! 	  && TYPE_DOMAIN (TREE_TYPE (array))
! 	  && ! int_fits_type_p (index, TYPE_DOMAIN (TREE_TYPE (array))))
  	{
  	  if (!c_mark_addressable (array))
*** dwarf2out.c	17 Mar 2004 08:06:31 -0000	1.503
--- dwarf2out.c	18 Mar 2004 03:39:03 -0000
*************** gen_enumeration_type_die (tree type, dw_
*** 10854,10858 ****
  	add_child_die (scope_die_for (type, context_die), type_die);
  
!       for (link = TYPE_FIELDS (type);
  	   link != NULL; link = TREE_CHAIN (link))
  	{
--- 10854,10858 ----
  	add_child_die (scope_die_for (type, context_die), type_die);
  
!       for (link = TYPE_VALUES (type);
  	   link != NULL; link = TREE_CHAIN (link))
  	{
*** tree.c	16 Mar 2004 20:37:16 -0000	1.354
--- tree.c	18 Mar 2004 03:39:12 -0000
*************** type_hash_list (tree list, hashval_t has
*** 3081,3085 ****
  /* These are the Hashtable callback functions.  */
  
! /* Returns true if the types are equal.  */
  
  static int
--- 3081,3085 ----
  /* These are the Hashtable callback functions.  */
  
! /* Returns true iff the types are equivalent.  */
  
  static int
*************** type_hash_eq (const void *va, const void
*** 3087,3112 ****
  {
    const struct type_hash *a = va, *b = vb;
!   if (a->hash == b->hash
!       && TREE_CODE (a->type) == TREE_CODE (b->type)
!       && TREE_TYPE (a->type) == TREE_TYPE (b->type)
!       && attribute_list_equal (TYPE_ATTRIBUTES (a->type),
! 			       TYPE_ATTRIBUTES (b->type))
!       && TYPE_ALIGN (a->type) == TYPE_ALIGN (b->type)
!       && (TYPE_MAX_VALUE (a->type) == TYPE_MAX_VALUE (b->type)
! 	  || tree_int_cst_equal (TYPE_MAX_VALUE (a->type),
! 				 TYPE_MAX_VALUE (b->type)))
!       && (TYPE_MIN_VALUE (a->type) == TYPE_MIN_VALUE (b->type)
! 	  || tree_int_cst_equal (TYPE_MIN_VALUE (a->type),
! 				 TYPE_MIN_VALUE (b->type)))
!       /* Note that TYPE_DOMAIN is TYPE_ARG_TYPES for FUNCTION_TYPE.  */
!       && (TYPE_DOMAIN (a->type) == TYPE_DOMAIN (b->type)
! 	  || (TYPE_DOMAIN (a->type)
! 	      && TREE_CODE (TYPE_DOMAIN (a->type)) == TREE_LIST
! 	      && TYPE_DOMAIN (b->type)
! 	      && TREE_CODE (TYPE_DOMAIN (b->type)) == TREE_LIST
! 	      && type_list_equal (TYPE_DOMAIN (a->type),
! 				  TYPE_DOMAIN (b->type)))))
!     return 1;
!   return 0;
  }
  
--- 3087,3173 ----
  {
    const struct type_hash *a = va, *b = vb;
! 
!   /* First test the things that are the same for all types.  */
!   if (a->hash != b->hash
!       || TREE_CODE (a->type) != TREE_CODE (b->type)
!       || TREE_TYPE (a->type) != TREE_TYPE (b->type)
!       || !attribute_list_equal (TYPE_ATTRIBUTES (a->type),
! 				 TYPE_ATTRIBUTES (b->type))
!       || TYPE_ALIGN (a->type) != TYPE_ALIGN (b->type)
!       || TYPE_MODE (a->type) != TYPE_MODE (b->type))
!     return 0;
! 
!   switch (TREE_CODE (a->type))
!     {
!     case VOID_TYPE:
!     case COMPLEX_TYPE:
!     case POINTER_TYPE:
!     case REFERENCE_TYPE:
!       return 1;
! 
!     case ENUMERAL_TYPE:
!       if (TYPE_VALUES (a->type) != TYPE_VALUES (b->type)
! 	  && !(TYPE_VALUES (a->type)
! 	       && TREE_CODE (TYPE_VALUES (a->type)) == TREE_LIST
! 	       && TYPE_VALUES (b->type)
! 	       && TREE_CODE (TYPE_VALUES (b->type)) == TREE_LIST
! 	       && type_list_equal (TYPE_VALUES (a->type),
! 				   TYPE_VALUES (b->type))))
! 	return 0;
! 
!       /* ... fall through ... */
! 
!     case INTEGER_TYPE:
!     case REAL_TYPE:
!     case BOOLEAN_TYPE:
!     case CHAR_TYPE:
!       return ((TYPE_MAX_VALUE (a->type) == TYPE_MAX_VALUE (b->type)
! 	       || tree_int_cst_equal (TYPE_MAX_VALUE (a->type),
! 				      TYPE_MAX_VALUE (b->type)))
! 	      && (TYPE_MIN_VALUE (a->type) == TYPE_MIN_VALUE (b->type)
! 		  && tree_int_cst_equal (TYPE_MIN_VALUE (a->type),
! 					 TYPE_MIN_VALUE (b->type))));
! 
!     case OFFSET_TYPE:
!       return TYPE_OFFSET_BASETYPE (a->type) == TYPE_OFFSET_BASETYPE (b->type);
! 
!     case METHOD_TYPE:
!       return (TYPE_METHOD_BASETYPE (a->type) == TYPE_METHOD_BASETYPE (b->type)
! 	      && (TYPE_ARG_TYPES (a->type) == TYPE_ARG_TYPES (b->type)
! 		  || (TYPE_ARG_TYPES (a->type)
! 		      && TREE_CODE (TYPE_ARG_TYPES (a->type)) == TREE_LIST
! 		      && TYPE_ARG_TYPES (b->type)
! 		      && TREE_CODE (TYPE_ARG_TYPES (b->type)) == TREE_LIST
! 		      && type_list_equal (TYPE_ARG_TYPES (a->type),
! 					  TYPE_ARG_TYPES (b->type)))));
! 								      
!     case ARRAY_TYPE:
!     case SET_TYPE:
!     case VECTOR_TYPE:
!       return TYPE_DOMAIN (a->type) == TYPE_DOMAIN (b->type);
! 
!     case RECORD_TYPE:
!     case UNION_TYPE:
!     case QUAL_UNION_TYPE:
!       return (TYPE_FIELDS (a->type) == TYPE_FIELDS (b->type)
! 	      || (TYPE_FIELDS (a->type)
! 		  && TREE_CODE (TYPE_FIELDS (a->type)) == TREE_LIST
! 		  && TYPE_FIELDS (b->type)
! 		  && TREE_CODE (TYPE_FIELDS (b->type)) == TREE_LIST
! 		  && type_list_equal (TYPE_FIELDS (a->type),
! 				      TYPE_FIELDS (b->type))));
! 
!     case FUNCTION_TYPE:
!       return (TYPE_ARG_TYPES (a->type) == TYPE_ARG_TYPES (b->type)
! 	      || (TYPE_ARG_TYPES (a->type)
! 		  && TREE_CODE (TYPE_ARG_TYPES (a->type)) == TREE_LIST
! 		  && TYPE_ARG_TYPES (b->type)
! 		  && TREE_CODE (TYPE_ARG_TYPES (b->type)) == TREE_LIST
! 		  && type_list_equal (TYPE_ARG_TYPES (a->type),
! 				      TYPE_ARG_TYPES (b->type))));
! 
!     default:
!       return 0;
!     }
  }
  
*************** get_set_constructor_bytes (tree init, un
*** 4895,4898 ****
--- 4956,4960 ----
  
  #if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
+ 
  /* Complain that the tree code of NODE does not match the expected CODE.
     FILE, LINE, and FUNCTION are of the caller.  */
*************** tree_check_failed (const tree node, enum
*** 4907,4911 ****
  }
  
! /* Similar to above, except that we check for a class of tree
     code, given in CL.  */
  
--- 4969,5015 ----
  }
  
! /* Similar to above except that we allowed the code to be one of two
!    different codes.  */
! 
! void
! tree_check2_failed (const tree node, enum tree_code code1,
! 		    enum tree_code code2, const char *file,
! 		    int line, const char *function)
! {
!   internal_error ("tree check: expected %s or %s, have %s in %s, at %s:%d",
! 		  tree_code_name[code1], tree_code_name[code2],
! 		  tree_code_name[TREE_CODE (node)],
! 		  function, trim_filename (file), line);
! }
! 
! /* Likewise for three different codes.  */
! 
! void
! tree_check3_failed (const tree node, enum tree_code code1,
! 		    enum tree_code code2, enum tree_code code3,
! 		    const char *file, int line, const char *function)
! {
!   internal_error ("tree check: expected %s, %s or %s; have %s in %s, at %s:%d",
! 		  tree_code_name[code1], tree_code_name[code2],
! 		  tree_code_name[code3], tree_code_name[TREE_CODE (node)],
! 		  function, trim_filename (file), line);
! }
! 
! /* ... and for four different codes.  */
! 
! void
! tree_check5_failed (const tree node, enum tree_code code1,
! 		    enum tree_code code2, enum tree_code code3,
! 		    enum tree_code code4, enum tree_code code5,
! 		    const char *file, int line, const char *function)
! {
!   internal_error
!     ("tree check: expected %s, %s, %s, %s or %s; have %s in %s, at %s:%d",
!      tree_code_name[code1], tree_code_name[code2], tree_code_name[code3],
!      tree_code_name[code4], tree_code_name[code5],
!      tree_code_name[TREE_CODE (node)], function, trim_filename (file), line);
! }
! 
! /* Similar to tree_check_failed, except that we check for a class of tree
     code, given in CL.  */
  
*** tree.h	16 Mar 2004 20:37:16 -0000	1.478
--- tree.h	18 Mar 2004 03:39:19 -0000
*************** struct tree_common GTY(())
*** 308,311 ****
--- 308,339 ----
      __t; })
  
+ #define TREE_CHECK2(T, CODE1, CODE2) __extension__			\
+ ({  const tree __t = (T);						\
+     if (TREE_CODE (__t) != (CODE1)					\
+ 	&& TREE_CODE (__t) != (CODE2))					\
+       tree_check2_failed (__t, (CODE1), (CODE2), __FILE__, __LINE__,	\
+ 			  __FUNCTION__);				\
+     __t; })
+ 
+ #define TREE_CHECK3(T, CODE1, CODE2, CODE3) __extension__		\
+ ({  const tree __t = (T);						\
+     if (TREE_CODE (__t) != (CODE1)					\
+ 	&& TREE_CODE (__t) != (CODE2)					\
+ 	&& TREE_CODE (__t) != (CODE3))					\
+       tree_check3_failed (__t, (CODE1), (CODE2), (CODE3), __FILE__,	\
+ 			  __LINE__, __FUNCTION__);			\
+     __t; })
+ 
+ #define TREE_CHECK5(T, CODE1, CODE2, CODE3, CODE4, CODE5) __extension__	\
+ ({  const tree __t = (T);						\
+     if (TREE_CODE (__t) != (CODE1)					\
+ 	&& TREE_CODE (__t) != (CODE2)					\
+ 	&& TREE_CODE (__t) != (CODE3)					\
+ 	&& TREE_CODE (__t) != (CODE4)					\
+ 	&& TREE_CODE (__t) != (CODE5))					\
+       tree_check5_failed (__t, (CODE1), (CODE2), (CODE3), (CODE4),	\
+ 			  (CODE5), __FILE__, __LINE__, __FUNCTION__);	\
+     __t; })
+ 
  #define TREE_CLASS_CHECK(T, CLASS) __extension__			\
  ({  const tree __t = (T);						\
*************** extern void tree_check_failed (const tre
*** 368,371 ****
--- 396,410 ----
  			       const char *, int, const char *)
      ATTRIBUTE_NORETURN;
+ extern void tree_check2_failed (const tree, enum tree_code, enum tree_code,
+ 			       const char *, int, const char *)
+     ATTRIBUTE_NORETURN;
+ extern void tree_check3_failed (const tree, enum tree_code, enum tree_code,
+ 				enum tree_code, const char *, int,
+ 				const char *)
+     ATTRIBUTE_NORETURN;
+ extern void tree_check5_failed (const tree, enum tree_code, enum tree_code,
+ 				enum tree_code, enum tree_code, enum tree_code,
+ 				const char *, int, const char *)
+     ATTRIBUTE_NORETURN;
  extern void tree_class_check_failed (const tree, int,
  				     const char *, int, const char *)
*************** extern void tree_operand_check_failed (i
*** 381,390 ****
  #else /* not ENABLE_TREE_CHECKING, or not gcc */
  
! #define TREE_CHECK(T, CODE)		(T)
! #define TREE_CLASS_CHECK(T, CODE)	(T)
! #define EXPR_CHECK(T)			(T)
! #define TREE_VEC_ELT_CHECK(T, I)	((T)->vec.a[I])
! #define TREE_OPERAND_CHECK(T, I)	((T)->exp.operands[I])
! #define TREE_OPERAND_CHECK_CODE(T, CODE, I) ((T)->exp.operands[I])
  #define TREE_RTL_OPERAND_CHECK(T, CODE, I)  (*(rtx *) &((T)->exp.operands[I]))
  
--- 420,432 ----
  #else /* not ENABLE_TREE_CHECKING, or not gcc */
  
! #define TREE_CHECK(T, CODE)			(T)
! #define TREE_CHECK2(T, CODE1, CODE2)		(T)
! #define TREE_CHECK3(T, CODE1, CODE2, CODE3)	(T)
! #define TREE_CHECK5(T, CODE1, CODE2, CODE3, CODE4, CODE5) (T)
! #define TREE_CLASS_CHECK(T, CODE)		(T)
! #define EXPR_CHECK(T)				(T)
! #define TREE_VEC_ELT_CHECK(T, I)		((T)->vec.a[I])
! #define TREE_OPERAND_CHECK(T, I)		((T)->exp.operands[I])
! #define TREE_OPERAND_CHECK_CODE(T, CODE, I)	((T)->exp.operands[I])
  #define TREE_RTL_OPERAND_CHECK(T, CODE, I)  (*(rtx *) &((T)->exp.operands[I]))
  
*************** extern void tree_operand_check_failed (i
*** 397,400 ****
--- 439,453 ----
  #define CST_CHECK(T)		TREE_CLASS_CHECK (T, 'c')
  #define STMT_CHECK(T)		TREE_CLASS_CHECK (T, 's')
+ #define FUNC_OR_METHOD_CHECK(T)	TREE_CHECK2 (T, FUNCTION_TYPE, METHOD_TYPE)
+ 
+ #define SET_ARRAY_OR_VECTOR_CHECK(T) \
+   TREE_CHECK3 (T, ARRAY_TYPE, SET_TYPE, VECTOR_TYPE)
+ 
+ #define REC_OR_UNION_CHECK(T)	\
+   TREE_CHECK3 (T, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE)
+ 
+ #define NUMERICAL_TYPE_CHECK(T)					\
+   TREE_CHECK5 (T, INTEGER_TYPE, ENUMERAL_TYPE, BOOLEAN_TYPE,	\
+ 	       CHAR_TYPE, REAL_TYPE)
  
  /* In all nodes that are expressions, this is the data type of the expression.
*************** struct tree_block GTY(())
*** 946,950 ****
  
  /* See tree.def for documentation of the use of these fields.
!    Look at the documentation of the various ..._TYPE tree codes.  */
  
  #define TYPE_UID(NODE) (TYPE_CHECK (NODE)->type.uid)
--- 999,1009 ----
  
  /* See tree.def for documentation of the use of these fields.
!    Look at the documentation of the various ..._TYPE tree codes.
! 
!    Note that the type.values, type.minval, and type.maxval fiels are
!    overloaded and used for different macros in different kinds of types.
!    Each macro must check to ensure the tree node is of the proper kind of
!    type.  Note also that some of the front-ends also overload these fields,
!    so they must be checked as well.  */
  
  #define TYPE_UID(NODE) (TYPE_CHECK (NODE)->type.uid)
*************** struct tree_block GTY(())
*** 952,967 ****
  #define TYPE_SIZE_UNIT(NODE) (TYPE_CHECK (NODE)->type.size_unit)
  #define TYPE_MODE(NODE) (TYPE_CHECK (NODE)->type.mode)
! #define TYPE_VALUES(NODE) (TYPE_CHECK (NODE)->type.values)
! #define TYPE_DOMAIN(NODE) (TYPE_CHECK (NODE)->type.values)
! #define TYPE_FIELDS(NODE) (TYPE_CHECK (NODE)->type.values)
! #define TYPE_METHODS(NODE) (TYPE_CHECK (NODE)->type.maxval)
! #define TYPE_VFIELD(NODE) (TYPE_CHECK (NODE)->type.minval)
! #define TYPE_ARG_TYPES(NODE) (TYPE_CHECK (NODE)->type.values)
! #define TYPE_METHOD_BASETYPE(NODE) (TYPE_CHECK (NODE)->type.maxval)
! #define TYPE_OFFSET_BASETYPE(NODE) (TYPE_CHECK (NODE)->type.maxval)
  #define TYPE_POINTER_TO(NODE) (TYPE_CHECK (NODE)->type.pointer_to)
  #define TYPE_REFERENCE_TO(NODE) (TYPE_CHECK (NODE)->type.reference_to)
! #define TYPE_MIN_VALUE(NODE) (TYPE_CHECK (NODE)->type.minval)
! #define TYPE_MAX_VALUE(NODE) (TYPE_CHECK (NODE)->type.maxval)
  #define TYPE_PRECISION(NODE) (TYPE_CHECK (NODE)->type.precision)
  #define TYPE_SYMTAB_ADDRESS(NODE) (TYPE_CHECK (NODE)->type.symtab.address)
--- 1011,1027 ----
  #define TYPE_SIZE_UNIT(NODE) (TYPE_CHECK (NODE)->type.size_unit)
  #define TYPE_MODE(NODE) (TYPE_CHECK (NODE)->type.mode)
! #define TYPE_ORIG_SIZE_TYPE(NODE) (INTEGER_TYPE_CHECK (NODE)->type.values)
! #define TYPE_VALUES(NODE) (ENUMERAL_TYPE_CHECK (NODE)->type.values)
! #define TYPE_DOMAIN(NODE) (SET_ARRAY_OR_VECTOR_CHECK (NODE)->type.values)
! #define TYPE_FIELDS(NODE) (REC_OR_UNION_CHECK (NODE)->type.values)
! #define TYPE_METHODS(NODE) (REC_OR_UNION_CHECK (NODE)->type.maxval)
! #define TYPE_VFIELD(NODE) (REC_OR_UNION_CHECK (NODE)->type.minval)
! #define TYPE_ARG_TYPES(NODE) (FUNC_OR_METHOD_CHECK (NODE)->type.values)
! #define TYPE_METHOD_BASETYPE(NODE) (FUNC_OR_METHOD_CHECK (NODE)->type.maxval)
! #define TYPE_OFFSET_BASETYPE(NODE) (OFFSET_TYPE_CHECK (NODE)->type.maxval)
  #define TYPE_POINTER_TO(NODE) (TYPE_CHECK (NODE)->type.pointer_to)
  #define TYPE_REFERENCE_TO(NODE) (TYPE_CHECK (NODE)->type.reference_to)
! #define TYPE_MIN_VALUE(NODE) (NUMERICAL_TYPE_CHECK (NODE)->type.minval)
! #define TYPE_MAX_VALUE(NODE) (NUMERICAL_TYPE_CHECK (NODE)->type.maxval)
  #define TYPE_PRECISION(NODE) (TYPE_CHECK (NODE)->type.precision)
  #define TYPE_SYMTAB_ADDRESS(NODE) (TYPE_CHECK (NODE)->type.symtab.address)
*** cp/class.c	9 Mar 2004 08:16:40 -0000	1.603
--- cp/class.c	18 Mar 2004 03:39:59 -0000
*************** finish_struct_bits (tree t)
*** 1423,1428 ****
        TYPE_USES_VIRTUAL_BASECLASSES (variants) = TYPE_USES_VIRTUAL_BASECLASSES (t);
        /* Copy whatever these are holding today.  */
!       TYPE_MIN_VALUE (variants) = TYPE_MIN_VALUE (t);
!       TYPE_MAX_VALUE (variants) = TYPE_MAX_VALUE (t);
        TYPE_FIELDS (variants) = TYPE_FIELDS (t);
        TYPE_SIZE (variants) = TYPE_SIZE (t);
--- 1423,1428 ----
        TYPE_USES_VIRTUAL_BASECLASSES (variants) = TYPE_USES_VIRTUAL_BASECLASSES (t);
        /* Copy whatever these are holding today.  */
!       TYPE_VFIELD (variants) = TYPE_VFIELD (t);
!       TYPE_METHODS (variants) = TYPE_METHODS (t);
        TYPE_FIELDS (variants) = TYPE_FIELDS (t);
        TYPE_SIZE (variants) = TYPE_SIZE (t);
*** cp/error.c	1 Mar 2004 21:04:30 -0000	1.246
--- cp/error.c	18 Mar 2004 03:40:07 -0000
*************** dump_type (tree t, int flags)
*** 405,409 ****
      case TYPEOF_TYPE:
        pp_string (cxx_pp, "__typeof (");
!       dump_expr (TYPE_FIELDS (t), flags & ~TFF_EXPR_IN_PARENS);
        pp_right_paren (cxx_pp);
        break;
--- 405,409 ----
      case TYPEOF_TYPE:
        pp_string (cxx_pp, "__typeof (");
!       dump_expr (TYPEOF_TYPE_EXPR (t), flags & ~TFF_EXPR_IN_PARENS);
        pp_right_paren (cxx_pp);
        break;
*** cp/pt.c	16 Mar 2004 22:18:05 -0000	1.840
--- cp/pt.c	18 Mar 2004 03:40:14 -0000
*************** tsubst (tree t, tree args, tsubst_flags_
*** 7224,7229 ****
  	tree type;
  
! 	type = finish_typeof (tsubst_expr (TYPE_FIELDS (t), args, complain, 
! 					   in_decl));
  	return cp_build_qualified_type_real (type,
  					     cp_type_quals (t)
--- 7224,7229 ----
  	tree type;
  
! 	type = finish_typeof (tsubst_expr (TYPEOF_TYPE_EXPR (t), args,
! 					   complain, in_decl));
  	return cp_build_qualified_type_real (type,
  					     cp_type_quals (t)
*** cp/search.c	9 Mar 2004 08:16:41 -0000	1.288
--- cp/search.c	18 Mar 2004 03:40:15 -0000
*************** dfs_unuse_fields (tree binfo, void *data
*** 2250,2254 ****
    tree fields;
  
!   for (fields = TYPE_FIELDS (type); fields; fields = TREE_CHAIN (fields))
      {
        if (TREE_CODE (fields) != FIELD_DECL || DECL_ARTIFICIAL (fields))
--- 2250,2263 ----
    tree fields;
  
!   if (TREE_CODE (type) == TYPENAME_TYPE)
!     fields = TYPENAME_TYPE_FULLNAME (type);
!   else if (TREE_CODE (type) == TYPEOF_TYPE)
!     fields = TYPEOF_TYPE_EXPR (type);
!   else if (TREE_CODE (type) == TEMPLATE_TYPE_PARM)
!     fields = TEMPLATE_TYPE_PARM_INDEX (type);
!   else
!     fields = TYPE_FIELDS (type);
! 
!   for (; fields; fields = TREE_CHAIN (fields))
      {
        if (TREE_CODE (fields) != FIELD_DECL || DECL_ARTIFICIAL (fields))
*** cp/semantics.c	16 Mar 2004 22:18:06 -0000	1.390
--- cp/semantics.c	18 Mar 2004 03:40:18 -0000
*************** finish_typeof (tree expr)
*** 2686,2690 ****
      {
        type = make_aggr_type (TYPEOF_TYPE);
!       TYPE_FIELDS (type) = expr;
  
        return type;
--- 2686,2690 ----
      {
        type = make_aggr_type (TYPEOF_TYPE);
!       TYPEOF_TYPE_EXPR (type) = expr;
  
        return type;
*** cp/typeck.c	16 Mar 2004 22:18:07 -0000	1.532
--- cp/typeck.c	18 Mar 2004 03:40:24 -0000
*************** comptypes (tree t1, tree t2, int strict)
*** 954,963 ****
       language version.  */
    if (TREE_CODE (t1) == INTEGER_TYPE && TYPE_IS_SIZETYPE (t1)
!       && TYPE_DOMAIN (t1))
!     t1 = TYPE_DOMAIN (t1);
  
    if (TREE_CODE (t2) == INTEGER_TYPE && TYPE_IS_SIZETYPE (t2)
!       && TYPE_DOMAIN (t2))
!     t2 = TYPE_DOMAIN (t2);
  
    if (TYPE_PTRMEMFUNC_P (t1))
--- 954,963 ----
       language version.  */
    if (TREE_CODE (t1) == INTEGER_TYPE && TYPE_IS_SIZETYPE (t1)
!       && TYPE_ORIG_SIZE_TYPE (t1))
!     t1 = TYPE_ORIG_SIZE_TYPE (t1);
  
    if (TREE_CODE (t2) == INTEGER_TYPE && TYPE_IS_SIZETYPE (t2)
!       && TYPE_ORIG_SIZE_TYPE (t2))
!     t2 = TYPE_ORIG_SIZE_TYPE (t2);
  
    if (TYPE_PTRMEMFUNC_P (t1))
*************** build_array_ref (tree array, tree idx)
*** 2198,2203 ****
  	 to access a non-existent part of the register.  */
        if (TREE_CODE (idx) == INTEGER_CST
! 	  && TYPE_VALUES (TREE_TYPE (array))
! 	  && ! int_fits_type_p (idx, TYPE_VALUES (TREE_TYPE (array))))
  	{
  	  if (!cxx_mark_addressable (array))
--- 2198,2203 ----
  	 to access a non-existent part of the register.  */
        if (TREE_CODE (idx) == INTEGER_CST
! 	  && TYPE_DOMAIN (TREE_TYPE (array))
! 	  && ! int_fits_type_p (idx, TYPE_DOMAIN (TREE_TYPE (array))))
  	{
  	  if (!cxx_mark_addressable (array))
*** java/java-tree.h	26 Feb 2004 04:58:07 -0000	1.195
--- java/java-tree.h	18 Mar 2004 03:40:47 -0000
*************** struct JCF;
*** 118,124 ****
  */
  
  /* True if the class whose TYPE_BINFO this is has a superclass.
     (True of all classes except Object.) */
! #define CLASS_HAS_SUPER_FLAG(BINFO) TREE_LANG_FLAG_1(BINFO)
  #define CLASS_HAS_SUPER(TYPE) CLASS_HAS_SUPER_FLAG (TYPE_BINFO (TYPE))
  
--- 118,127 ----
  */
  
+ #define VAR_OR_FIELD_CHECK(DECL) \
+   TREE_CHECK3 (DECL, FIELD_DECL, VAR_DECL, PARM_DECL)
+ 
  /* True if the class whose TYPE_BINFO this is has a superclass.
     (True of all classes except Object.) */
! #define CLASS_HAS_SUPER_FLAG(BINFO) TREE_LANG_FLAG_1 (TREE_VEC_CHECK (BINFO))
  #define CLASS_HAS_SUPER(TYPE) CLASS_HAS_SUPER_FLAG (TYPE_BINFO (TYPE))
  
*************** union lang_tree_node 
*** 823,842 ****
  
  /* True when DECL (a field) is Synthetic.  */
! #define FIELD_SYNTHETIC(DECL) DECL_LANG_FLAG_2 (DECL)
  
  /* True when DECL aliases an outer context local variable.  */
! #define FIELD_LOCAL_ALIAS(DECL) DECL_LANG_FLAG_6 (DECL)
  
  /* True when DECL, which aliases an outer context local variable is
     used by the inner classe */
! #define FIELD_LOCAL_ALIAS_USED(DECL) DECL_LANG_FLAG_7 (DECL)
  
  /* True when DECL is a this$<n> field. Note that
     FIELD_LOCAL_ALIAS_USED can be differentiated when tested against
     FIELD_LOCAL_ALIAS.  */
! #define FIELD_THISN(DECL) DECL_LANG_FLAG_7 (DECL)
  
  /* In a LABEL_DECL, a TREE_VEC that saves the type_map at that point. */
! #define LABEL_TYPE_STATE(NODE) (DECL_INITIAL (NODE))
  
  /* In the label of a subroutine, a dummy label that records the
--- 826,845 ----
  
  /* True when DECL (a field) is Synthetic.  */
! #define FIELD_SYNTHETIC(DECL) DECL_LANG_FLAG_2 (VAR_OR_FIELD_CHECK (DECL))
  
  /* True when DECL aliases an outer context local variable.  */
! #define FIELD_LOCAL_ALIAS(DECL) DECL_LANG_FLAG_6 (VAR_OR_FIELD_CHECK (DECL))
  
  /* True when DECL, which aliases an outer context local variable is
     used by the inner classe */
! #define FIELD_LOCAL_ALIAS_USED(DECL) DECL_LANG_FLAG_7 (VAR_OR_FIELD_CHECK (DECL))
  
  /* True when DECL is a this$<n> field. Note that
     FIELD_LOCAL_ALIAS_USED can be differentiated when tested against
     FIELD_LOCAL_ALIAS.  */
! #define FIELD_THISN(DECL) DECL_LANG_FLAG_7 (VAR_OR_FIELD_CHECK (DECL))
  
  /* In a LABEL_DECL, a TREE_VEC that saves the type_map at that point. */
! #define LABEL_TYPE_STATE(NODE) (DECL_INITIAL (LABEL_DECL_CHECK (NODE)))
  
  /* In the label of a subroutine, a dummy label that records the
*************** union lang_tree_node 
*** 845,860 ****
  
  /* In the label of a sub-routine, records the type state at return.
!  * A local may be TYPE_UNUSED, which means that the local is not
!  * used (stored to or loaded from) in this subroutine - at least for
!  * code that we have verified so far. */
! #define LABEL_RETURN_TYPE_STATE(NODE) LABEL_TYPE_STATE (LABEL_RETURN_LABEL (NODE))
  
  /* In a TREE_VEC for a LABEL_RETURN_TYPE_STATE, notes that
     TREE_VEC_LENGTH has been adjusted to the correct stack size. */
! #define RETURN_MAP_ADJUSTED(NODE) TREE_LANG_FLAG_2(NODE)
  
  /* In the label of a sub-routine, a chain of the return location labels. */
  #define LABEL_RETURN_LABELS(node) \
!   (LABEL_DECL_CHECK (LABEL_RETURN_LABEL(node))->decl.result)
  
  /* In a LABEL_DECL, the next pending label.
--- 848,864 ----
  
  /* In the label of a sub-routine, records the type state at return.
!    A local may be TYPE_UNUSED, which means that the local is not
!    used (stored to or loaded from) in this subroutine - at least for
!    code that we have verified so far. */
! #define LABEL_RETURN_TYPE_STATE(NODE) \
!   LABEL_TYPE_STATE (LABEL_RETURN_LABEL (NODE))
  
  /* In a TREE_VEC for a LABEL_RETURN_TYPE_STATE, notes that
     TREE_VEC_LENGTH has been adjusted to the correct stack size. */
! #define RETURN_MAP_ADJUSTED(NODE) TREE_LANG_FLAG_2 (TREE_VEC_CHECK (NODE))
  
  /* In the label of a sub-routine, a chain of the return location labels. */
  #define LABEL_RETURN_LABELS(node) \
!   (LABEL_DECL_CHECK (LABEL_RETURN_LABEL (node))->decl.result)
  
  /* In a LABEL_DECL, the next pending label.
*************** union lang_tree_node 
*** 863,881 ****
  
  /* In a LABEL_DECL, the corresponding bytecode program counter. */
! #define LABEL_PC(NODE) ((NODE)->decl.u2.i)
  
  /* Used during verification to mark the label has "changed". (See JVM Spec). */
! #define LABEL_CHANGED(NODE) DECL_LANG_FLAG_6(NODE)
  
  /* In a LABEL_DECL, true if we have verified instructions starting here. */
! #define LABEL_VERIFIED(NODE) (instruction_bits[LABEL_PC(NODE)]&BCODE_VERIFIED)
  
  /* True if this code is within a subroutine (target of a jsr). */
! #define LABEL_IN_SUBR(NODE) DECL_LANG_FLAG_4(NODE)
  /* True if this code is the start of a subroutine (target of a jsr). */
! #define LABEL_IS_SUBR_START(NODE) DECL_LANG_FLAG_5(NODE)
  
  /* In a LABEL_DECL, if LABEL_IN_SUBR(NODE), points to start of subroutine. */
! #define LABEL_SUBR_START(NODE) DECL_ABSTRACT_ORIGIN(NODE)
  
  /* In a LABEL_DECL that has LABEL_IS_SUBR_START, this points to the start
--- 867,886 ----
  
  /* In a LABEL_DECL, the corresponding bytecode program counter. */
! #define LABEL_PC(NODE) (LABEL_DECL_CHECK (NODE)->decl.u2.i)
  
  /* Used during verification to mark the label has "changed". (See JVM Spec). */
! #define LABEL_CHANGED(NODE) DECL_LANG_FLAG_6 (LABEL_DECL_CHECK (NODE))
  
  /* In a LABEL_DECL, true if we have verified instructions starting here. */
! #define LABEL_VERIFIED(NODE) \
!   (instruction_bits[LABEL_PC (NODE)] & BCODE_VERIFIED)
  
  /* True if this code is within a subroutine (target of a jsr). */
! #define LABEL_IN_SUBR(NODE) DECL_LANG_FLAG_4 (LABEL_DECL_CHECK (NODE))
  /* True if this code is the start of a subroutine (target of a jsr). */
! #define LABEL_IS_SUBR_START(NODE) DECL_LANG_FLAG_5 (LABEL_DECL_CHECK (NODE))
  
  /* In a LABEL_DECL, if LABEL_IN_SUBR(NODE), points to start of subroutine. */
! #define LABEL_SUBR_START(NODE) DECL_ABSTRACT_ORIGIN (LABEL_DECL_CHECK (NODE))
  
  /* In a LABEL_DECL that has LABEL_IS_SUBR_START, this points to the start
*************** union lang_tree_node 
*** 886,904 ****
  /* The slot number for this local variable. */
  #define DECL_LOCAL_SLOT_NUMBER(NODE) \
!   (DECL_LANG_SPECIFIC(NODE)->u.v.slot_number)
  /* The start (bytecode) pc for the valid range of this local variable. */
! #define DECL_LOCAL_START_PC(NODE) \
!   (DECL_LANG_SPECIFIC(NODE)->u.v.start_pc)
  /* The end (bytecode) pc for the valid range of this local variable. */
! #define DECL_LOCAL_END_PC(NODE) \
!   (DECL_LANG_SPECIFIC(NODE)->u.v.end_pc)
  /* For a VAR_DECLor PARM_DECL, used to chain decls with the same
     slot_number in decl_map. */
! #define DECL_LOCAL_SLOT_CHAIN(NODE) \
!   (DECL_LANG_SPECIFIC(NODE)->u.v.slot_chain)
  /* For a FIELD_DECL, holds the name of the access method. Used to
     read/write the content of the field from an inner class.  */
  #define FIELD_INNER_ACCESS(DECL) \
!   (DECL_LANG_SPECIFIC(DECL)->u.v.am)
  /* Safely tests whether FIELD_INNER_ACCESS exists or not. */
  #define FIELD_INNER_ACCESS_P(DECL) \
--- 891,906 ----
  /* The slot number for this local variable. */
  #define DECL_LOCAL_SLOT_NUMBER(NODE) \
!   (DECL_LANG_SPECIFIC (NODE)->u.v.slot_number)
  /* The start (bytecode) pc for the valid range of this local variable. */
! #define DECL_LOCAL_START_PC(NODE)  (DECL_LANG_SPECIFIC (NODE)->u.v.start_pc)
  /* The end (bytecode) pc for the valid range of this local variable. */
! #define DECL_LOCAL_END_PC(NODE)    (DECL_LANG_SPECIFIC (NODE)->u.v.end_pc)
  /* For a VAR_DECLor PARM_DECL, used to chain decls with the same
     slot_number in decl_map. */
! #define DECL_LOCAL_SLOT_CHAIN(NODE) (DECL_LANG_SPECIFIC(NODE)->u.v.slot_chain)
  /* For a FIELD_DECL, holds the name of the access method. Used to
     read/write the content of the field from an inner class.  */
  #define FIELD_INNER_ACCESS(DECL) \
!   (DECL_LANG_SPECIFIC (VAR_OR_FIELD_CHECK (DECL))->u.v.am)
  /* Safely tests whether FIELD_INNER_ACCESS exists or not. */
  #define FIELD_INNER_ACCESS_P(DECL) \
*************** union lang_tree_node 
*** 906,917 ****
  /* True if a final variable was initialized upon its declaration,
     or (if a field) in an initializer.  Set after definite assignment. */
! #define DECL_FIELD_FINAL_IUD(NODE) \
!   (DECL_LANG_SPECIFIC(NODE)->u.v.final_iud)
  /* The original WFL of a final variable. */
! #define DECL_FIELD_FINAL_WFL(NODE) \
!   (DECL_LANG_SPECIFIC(NODE)->u.v.wfl)
  /* The class that's the owner of a dynamic binding table.  */
! #define DECL_OWNER(NODE) \
!   (DECL_LANG_SPECIFIC(NODE)->u.v.owner)
  /* True if NODE is a local variable final. */
  #define LOCAL_FINAL_P(NODE) (DECL_LANG_SPECIFIC (NODE) && DECL_FINAL (NODE))
--- 908,916 ----
  /* True if a final variable was initialized upon its declaration,
     or (if a field) in an initializer.  Set after definite assignment. */
! #define DECL_FIELD_FINAL_IUD(NODE)  (DECL_LANG_SPECIFIC (NODE)->u.v.final_iud)
  /* The original WFL of a final variable. */
! #define DECL_FIELD_FINAL_WFL(NODE)  (DECL_LANG_SPECIFIC(NODE)->u.v.wfl)
  /* The class that's the owner of a dynamic binding table.  */
! #define DECL_OWNER(NODE)            (DECL_LANG_SPECIFIC(NODE)->u.v.owner)
  /* True if NODE is a local variable final. */
  #define LOCAL_FINAL_P(NODE) (DECL_LANG_SPECIFIC (NODE) && DECL_FINAL (NODE))
*************** union lang_tree_node 
*** 924,928 ****
     the flag to read or set it.  */
  #define LOCAL_CLASS_INITIALIZATION_FLAG(NODE) \
!     (DECL_LANG_SPECIFIC(NODE)->u.v.cif)
  /* True if NODE is a class initialization flag. */
  #define LOCAL_CLASS_INITIALIZATION_FLAG_P(NODE) \
--- 923,927 ----
     the flag to read or set it.  */
  #define LOCAL_CLASS_INITIALIZATION_FLAG(NODE) \
!     (DECL_LANG_SPECIFIC (NODE)->u.v.cif)
  /* True if NODE is a class initialization flag. */
  #define LOCAL_CLASS_INITIALIZATION_FLAG_P(NODE) \
*************** union lang_tree_node 
*** 930,934 ****
  /* True if NODE is a variable that is out of scope.  */
  #define LOCAL_VAR_OUT_OF_SCOPE_P(NODE) \
!     (DECL_LANG_SPECIFIC(NODE)->u.v.freed)
  /* Create a DECL_LANG_SPECIFIC if necessary. */
  #define MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC(T)			\
--- 929,933 ----
  /* True if NODE is a variable that is out of scope.  */
  #define LOCAL_VAR_OUT_OF_SCOPE_P(NODE) \
!     (DECL_LANG_SPECIFIC (NODE)->u.v.freed)
  /* Create a DECL_LANG_SPECIFIC if necessary. */
  #define MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC(T)			\
*************** union lang_tree_node 
*** 947,955 ****
     || TREE_CODE (NODE) == REAL_CST)
  
! /* For a local VAR_DECL, holds the index into a words bitstring that
!    specifies if this decl is definitively assigned.
     The value -1 means the variable has been definitely assigned (and not
     definitely unassigned).  The value -2 means we already reported an error. */
! #define DECL_BIT_INDEX(DECL) (DECL_CHECK (DECL)->decl.pointer_alias_set)
  
  /* DECL_LANG_SPECIFIC for FUNCTION_DECLs. */
--- 946,954 ----
     || TREE_CODE (NODE) == REAL_CST)
  
! /* For a local VAR_DECL or PARM_DECL, holds the index into a words bitstring
!    that specifies if this decl is definitively assigned.
     The value -1 means the variable has been definitely assigned (and not
     definitely unassigned).  The value -2 means we already reported an error. */
! #define DECL_BIT_INDEX(DECL) VAR_OR_FIELD_CHECK (DECL)->decl.pointer_alias_set
  
  /* DECL_LANG_SPECIFIC for FUNCTION_DECLs. */
*************** struct lang_decl_var GTY(())
*** 1021,1083 ****
  /* This is what 'lang_decl' really points to.  */
  
! enum lang_decl_desc {
!   LANG_DECL_FUNC,
!   LANG_DECL_VAR
! };
  
  struct lang_decl GTY(())
  {
    enum lang_decl_desc desc;
!   union lang_decl_u {
!     struct lang_decl_func GTY ((tag ("LANG_DECL_FUNC"))) f;
!     struct lang_decl_var GTY ((tag ("LANG_DECL_VAR"))) v;
!   } GTY ((desc ("%0.desc"))) u;
  };
  
  /* Macro to access fields in `struct lang_type'.  */
  
! #define TYPE_SIGNATURE(T) (TYPE_LANG_SPECIFIC(T)->signature)
! #define TYPE_JCF(T) (TYPE_LANG_SPECIFIC(T)->jcf)
! #define TYPE_CPOOL(T) (TYPE_LANG_SPECIFIC(T)->cpool)
! #define TYPE_CPOOL_DATA_REF(T) (TYPE_LANG_SPECIFIC(T)->cpool_data_ref)
! #define MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC(T)				 \
!   if (TYPE_LANG_SPECIFIC ((T)) == NULL)					 \
!     {									 \
!       TYPE_LANG_SPECIFIC ((T)) 					 	 \
!         = ggc_alloc_cleared (sizeof (struct lang_type));		 \
!     }
! 
! #define TYPE_FINIT_STMT_LIST(T)  (TYPE_LANG_SPECIFIC(T)->finit_stmt_list)
! #define TYPE_CLINIT_STMT_LIST(T) (TYPE_LANG_SPECIFIC(T)->clinit_stmt_list)
! #define TYPE_II_STMT_LIST(T)     (TYPE_LANG_SPECIFIC(T)->ii_block)
  /* The decl of the synthetic method `class$' used to handle `.class'
     for non primitive types when compiling to bytecode. */
! #define TYPE_DOT_CLASS(T)        (TYPE_LANG_SPECIFIC(T)->dot_class)
! #define TYPE_PACKAGE_LIST(T)     (TYPE_LANG_SPECIFIC(T)->package_list)
! #define TYPE_IMPORT_LIST(T)      (TYPE_LANG_SPECIFIC(T)->import_list)
! #define TYPE_IMPORT_DEMAND_LIST(T) (TYPE_LANG_SPECIFIC(T)->import_demand_list)
! #define TYPE_PRIVATE_INNER_CLASS(T) (TYPE_LANG_SPECIFIC(T)->pic)
! #define TYPE_PROTECTED_INNER_CLASS(T) (TYPE_LANG_SPECIFIC(T)->poic)
! #define TYPE_STRICTFP(T) (TYPE_LANG_SPECIFIC(T)->strictfp)
! #define TYPE_USES_ASSERTIONS(T) (TYPE_LANG_SPECIFIC(T)->assertions)
! 
! #define TYPE_ATABLE_METHODS(T)   (TYPE_LANG_SPECIFIC(T)->atable_methods)
! #define TYPE_ATABLE_SYMS_DECL(T) (TYPE_LANG_SPECIFIC(T)->atable_syms_decl)
! #define TYPE_ATABLE_DECL(T)      (TYPE_LANG_SPECIFIC(T)->atable_decl)
! 
! #define TYPE_OTABLE_METHODS(T)   (TYPE_LANG_SPECIFIC(T)->otable_methods)
! #define TYPE_OTABLE_SYMS_DECL(T) (TYPE_LANG_SPECIFIC(T)->otable_syms_decl)
! #define TYPE_OTABLE_DECL(T)      (TYPE_LANG_SPECIFIC(T)->otable_decl)
  
! #define TYPE_CTABLE_DECL(T)      (TYPE_LANG_SPECIFIC(T)->ctable_decl)
! #define TYPE_CATCH_CLASSES(T)    (TYPE_LANG_SPECIFIC(T)->catch_classes)
  
! #define TYPE_TO_RUNTIME_MAP(T)   (TYPE_LANG_SPECIFIC(T)->type_to_runtime_map)
  
  struct lang_type GTY(())
  {
    tree signature;
!   struct JCF * jcf;
!   struct CPool * cpool;
    tree cpool_data_ref;		/* Cached */
    tree finit_stmt_list;		/* List of statements finit$ will use */
--- 1020,1078 ----
  /* This is what 'lang_decl' really points to.  */
  
! enum lang_decl_desc {LANG_DECL_FUNC, LANG_DECL_VAR};
  
  struct lang_decl GTY(())
  {
    enum lang_decl_desc desc;
!   union lang_decl_u
!     {
!       struct lang_decl_func GTY ((tag ("LANG_DECL_FUNC"))) f;
!       struct lang_decl_var GTY ((tag ("LANG_DECL_VAR"))) v;
!     } GTY ((desc ("%0.desc"))) u;
  };
  
  /* Macro to access fields in `struct lang_type'.  */
  
! #define TYPE_SIGNATURE(T)	(TYPE_LANG_SPECIFIC (T)->signature)
! #define TYPE_JCF(T)		(TYPE_LANG_SPECIFIC (T)->jcf)
! #define TYPE_CPOOL(T)		(TYPE_LANG_SPECIFIC (T)->cpool)
! #define TYPE_CPOOL_DATA_REF(T)	(TYPE_LANG_SPECIFIC (T)->cpool_data_ref)
! #define MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC(T) \
!   if (TYPE_LANG_SPECIFIC ((T)) == NULL)		\
!      TYPE_LANG_SPECIFIC ((T))			\
!      = ggc_alloc_cleared (sizeof (struct lang_type));
! 
! #define TYPE_FINIT_STMT_LIST(T)  (TYPE_LANG_SPECIFIC (T)->finit_stmt_list)
! #define TYPE_CLINIT_STMT_LIST(T) (TYPE_LANG_SPECIFIC (T)->clinit_stmt_list)
! #define TYPE_II_STMT_LIST(T)     (TYPE_LANG_SPECIFIC (T)->ii_block)
  /* The decl of the synthetic method `class$' used to handle `.class'
     for non primitive types when compiling to bytecode. */
! #define TYPE_DOT_CLASS(T)        (TYPE_LANG_SPECIFIC (T)->dot_class)
! #define TYPE_PACKAGE_LIST(T)     (TYPE_LANG_SPECIFIC (T)->package_list)
! #define TYPE_IMPORT_LIST(T)      (TYPE_LANG_SPECIFIC (T)->import_list)
! #define TYPE_IMPORT_DEMAND_LIST(T) (TYPE_LANG_SPECIFIC (T)->import_demand_list)
! #define TYPE_PRIVATE_INNER_CLASS(T) (TYPE_LANG_SPECIFIC (T)->pic)
! #define TYPE_PROTECTED_INNER_CLASS(T) (TYPE_LANG_SPECIFIC (T)->poic)
! #define TYPE_STRICTFP(T) (TYPE_LANG_SPECIFIC (T)->strictfp)
! #define TYPE_USES_ASSERTIONS(T) (TYPE_LANG_SPECIFIC (T)->assertions)
! 
! #define TYPE_ATABLE_METHODS(T)   (TYPE_LANG_SPECIFIC (T)->atable_methods)
! #define TYPE_ATABLE_SYMS_DECL(T) (TYPE_LANG_SPECIFIC (T)->atable_syms_decl)
! #define TYPE_ATABLE_DECL(T)      (TYPE_LANG_SPECIFIC (T)->atable_decl)
! 
! #define TYPE_OTABLE_METHODS(T)   (TYPE_LANG_SPECIFIC (T)->otable_methods)
! #define TYPE_OTABLE_SYMS_DECL(T) (TYPE_LANG_SPECIFIC (T)->otable_syms_decl)
! #define TYPE_OTABLE_DECL(T)      (TYPE_LANG_SPECIFIC (T)->otable_decl)
  
! #define TYPE_CTABLE_DECL(T)      (TYPE_LANG_SPECIFIC (T)->ctable_decl)
! #define TYPE_CATCH_CLASSES(T)    (TYPE_LANG_SPECIFIC (T)->catch_classes)
  
! #define TYPE_TO_RUNTIME_MAP(T)   (TYPE_LANG_SPECIFIC (T)->type_to_runtime_map)
  
  struct lang_type GTY(())
  {
    tree signature;
!   struct JCF *jcf;
!   struct CPool *cpool;
    tree cpool_data_ref;		/* Cached */
    tree finit_stmt_list;		/* List of statements finit$ will use */
*************** struct lang_type GTY(())
*** 1092,1108 ****
    tree import_demand_list;	/* Imported types, in the CU of this class */
  
!   tree otable_methods;          /* List of static decls referred to by this class.  */
    tree otable_decl;		/* The static address table.  */
    tree otable_syms_decl;
  
!   tree atable_methods;          /* List of static decls referred to by this class.  */
    tree atable_decl;		/* The static address table.  */
    tree atable_syms_decl;
  
!   tree ctable_decl;             /* The table of classes for the runtime type matcher.  */
    tree catch_classes;
  
    htab_t GTY ((param_is (struct treetreehash_entry))) type_to_runtime_map;   
!                                 /* The mapping of classes to exception region markers.  */
  
    unsigned pic:1;		/* Private Inner Class. */
--- 1087,1107 ----
    tree import_demand_list;	/* Imported types, in the CU of this class */
  
!   tree otable_methods;          /* List of static decls referred to by this
! 				   class.  */
    tree otable_decl;		/* The static address table.  */
    tree otable_syms_decl;
  
!   tree atable_methods;          /* List of static decls referred to by this
! 				   class.  */
    tree atable_decl;		/* The static address table.  */
    tree atable_syms_decl;
  
!   tree ctable_decl;             /* The table of classes for the runtime
! 				   type matcher.  */
    tree catch_classes;
  
    htab_t GTY ((param_is (struct treetreehash_entry))) type_to_runtime_map;   
!                                 /* The mapping of classes to exception region
! 				   markers.  */
  
    unsigned pic:1;		/* Private Inner Class. */
*************** extern tree build_constants_constructor 
*** 1157,1162 ****
  extern tree build_ref_from_constant_pool (int);
  extern tree build_utf8_ref (tree);
! extern tree ident_subst (const char*, int, const char*, int, int, const char*);
! extern tree identifier_subst (const tree, const char *, int, int, const char *);
  extern int global_bindings_p (void);
  extern int kept_level_p (void);
--- 1156,1163 ----
  extern tree build_ref_from_constant_pool (int);
  extern tree build_utf8_ref (tree);
! extern tree ident_subst (const char *, int, const char *, int, int,
! 			 const char *);
! extern tree identifier_subst (const tree, const char *, int, int,
! 			      const char *);
  extern int global_bindings_p (void);
  extern int kept_level_p (void);
*************** extern tree build_prim_array_type (tree,
*** 1179,1188 ****
  extern tree build_java_array_type (tree, HOST_WIDE_INT);
  extern int is_compiled_class (tree);
! extern tree mangled_classname (const char*, tree);
  extern tree lookup_label (int);
! extern tree pop_type_0 (tree, char**);
  extern tree pop_type (tree);
  extern tree decode_newarray_type (int);
! extern tree lookup_field (tree*, tree);
  extern int is_array_type_p (tree);
  extern HOST_WIDE_INT java_array_type_length (tree);
--- 1180,1189 ----
  extern tree build_java_array_type (tree, HOST_WIDE_INT);
  extern int is_compiled_class (tree);
! extern tree mangled_classname (const char *, tree);
  extern tree lookup_label (int);
! extern tree pop_type_0 (tree, char **);
  extern tree pop_type (tree);
  extern tree decode_newarray_type (int);
! extern tree lookup_field (tree *, tree);
  extern int is_array_type_p (tree);
  extern HOST_WIDE_INT java_array_type_length (tree);
*************** extern void jcf_trim_old_input (struct J
*** 1298,1302 ****
  extern void jcf_print_utf8 (FILE *, const unsigned char *, int);
  extern void jcf_print_char (FILE *, int);
! extern void jcf_print_utf8_replace (FILE *, const unsigned char *, int, int, int);
  extern const char* open_class (const char *, struct JCF *, int, const char *);
  #endif
--- 1299,1304 ----
  extern void jcf_print_utf8 (FILE *, const unsigned char *, int);
  extern void jcf_print_char (FILE *, int);
! extern void jcf_print_utf8_replace (FILE *, const unsigned char *, int,
! 				    int, int);
  extern const char* open_class (const char *, struct JCF *, int, const char *);
  #endif
*************** extern void gen_indirect_dispatch_tables
*** 1350,1363 ****
  /* Access flags etc for a method (a FUNCTION_DECL): */
  
! #define METHOD_PUBLIC(DECL) DECL_LANG_FLAG_1 (DECL)
! #define METHOD_PRIVATE(DECL) TREE_PRIVATE (DECL)
! #define METHOD_PROTECTED(DECL) TREE_PROTECTED (DECL)
! #define METHOD_STATIC(DECL) DECL_LANG_FLAG_2 (DECL)
! #define METHOD_FINAL(DECL) DECL_FINAL (DECL)
! #define METHOD_SYNCHRONIZED(DECL) DECL_LANG_FLAG_4 (DECL)
! #define METHOD_NATIVE(DECL) (DECL_LANG_SPECIFIC(DECL)->u.f.native)
! #define METHOD_ABSTRACT(DECL) DECL_LANG_FLAG_5 (DECL)
! #define METHOD_STRICTFP(DECL) (DECL_LANG_SPECIFIC (DECL)->u.f.strictfp)
! #define METHOD_INVISIBLE(DECL) (DECL_LANG_SPECIFIC (DECL)->u.f.invisible)
  
  #define JAVA_FILE_P(NODE) TREE_LANG_FLAG_2 (NODE)
--- 1352,1368 ----
  /* Access flags etc for a method (a FUNCTION_DECL): */
  
! #define METHOD_PUBLIC(DECL) DECL_LANG_FLAG_1 (FUNCTION_DECL_CHECK (DECL))
! #define METHOD_PRIVATE(DECL) TREE_PRIVATE (FUNCTION_DECL_CHECK (DECL))
! #define METHOD_PROTECTED(DECL) TREE_PROTECTED (FUNCTION_DECL_CHECK (DECL))
! #define METHOD_STATIC(DECL) DECL_LANG_FLAG_2 (FUNCTION_DECL_CHECK (DECL))
! #define METHOD_FINAL(DECL) DECL_FINAL (FUNCTION_DECL_CHECK (DECL))
! #define METHOD_SYNCHRONIZED(DECL) DECL_LANG_FLAG_4 (FUNCTION_DECL_CHECK (DECL))
! #define METHOD_NATIVE(DECL) \
!   (DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (DECL))->u.f.native)
! #define METHOD_ABSTRACT(DECL) DECL_LANG_FLAG_5 (FUNCTION_DECL_CHECK (DECL))
! #define METHOD_STRICTFP(DECL) \
!   (DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (DECL))->u.f.strictfp)
! #define METHOD_INVISIBLE(DECL) \
!   (DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (DECL))->u.f.invisible)
  
  #define JAVA_FILE_P(NODE) TREE_LANG_FLAG_2 (NODE)
*************** extern void gen_indirect_dispatch_tables
*** 1367,1371 ****
  /* Other predicates on method decls  */
  
! #define DECL_CONSTRUCTOR_P(DECL) DECL_LANG_FLAG_7(DECL)
  
  #define DECL_INIT_P(DECL)   (ID_INIT_P (DECL_NAME (DECL)))
--- 1372,1376 ----
  /* Other predicates on method decls  */
  
! #define DECL_CONSTRUCTOR_P(DECL) DECL_LANG_FLAG_7 (FUNCTION_DECL_CHECK (DECL))
  
  #define DECL_INIT_P(DECL)   (ID_INIT_P (DECL_NAME (DECL)))
*************** extern void gen_indirect_dispatch_tables
*** 1382,1406 ****
  #define ID_INSTINIT_P(ID) ((ID) == instinit_identifier_node)
  
! /* Access flags etc for a variable/field (a FIELD_DECL): */
  
! #define FIELD_PRIVATE(DECL) TREE_PRIVATE (DECL)
! #define FIELD_PROTECTED(DECL) TREE_PROTECTED (DECL)
! #define FIELD_PUBLIC(DECL) DECL_LANG_FLAG_1 (DECL)
! #define FIELD_STATIC(DECL) TREE_STATIC (DECL)
! #define FIELD_FINAL(DECL) DECL_FINAL (DECL)
! #define FIELD_VOLATILE(DECL) DECL_LANG_FLAG_4 (DECL)
! #define FIELD_TRANSIENT(DECL) DECL_LANG_FLAG_5 (DECL)
  
  /* Access flags etc for a class (a TYPE_DECL): */
  
! #define CLASS_PUBLIC(DECL) DECL_LANG_FLAG_1 (DECL)
! #define CLASS_FINAL(DECL) DECL_FINAL (DECL)
! #define CLASS_INTERFACE(DECL) DECL_LANG_FLAG_4 (DECL)
! #define CLASS_ABSTRACT(DECL) DECL_LANG_FLAG_5 (DECL)
! #define CLASS_SUPER(DECL) DECL_LANG_FLAG_6 (DECL)
! #define CLASS_STATIC(DECL) DECL_LANG_FLAG_7 (DECL)
! #define CLASS_PRIVATE(DECL) (TYPE_PRIVATE_INNER_CLASS (TREE_TYPE (DECL)))
! #define CLASS_PROTECTED(DECL) (TYPE_PROTECTED_INNER_CLASS (TREE_TYPE (DECL)))
! #define CLASS_STRICTFP(DECL) (TYPE_STRICTFP (TREE_TYPE (DECL)))
  #define CLASS_USES_ASSERTIONS(DECL) (TYPE_USES_ASSERTIONS (TREE_TYPE (DECL)))
  
--- 1387,1411 ----
  #define ID_INSTINIT_P(ID) ((ID) == instinit_identifier_node)
  
! /* Access flags etc for variable/field (FIELD_DECL, VAR_DECL, or PARM_DECL): */
  
! #define FIELD_PRIVATE(DECL)	TREE_PRIVATE (VAR_OR_FIELD_CHECK (DECL))
! #define FIELD_PROTECTED(DECL)	TREE_PROTECTED (VAR_OR_FIELD_CHECK (DECL))
! #define FIELD_PUBLIC(DECL)	DECL_LANG_FLAG_1 (VAR_OR_FIELD_CHECK (DECL))
! #define FIELD_STATIC(DECL)	TREE_STATIC (VAR_OR_FIELD_CHECK (DECL))
! #define FIELD_FINAL(DECL)	DECL_FINAL (VAR_OR_FIELD_CHECK (DECL))
! #define FIELD_VOLATILE(DECL)	DECL_LANG_FLAG_4 (VAR_OR_FIELD_CHECK (DECL))
! #define FIELD_TRANSIENT(DECL)	DECL_LANG_FLAG_5 (VAR_OR_FIELD_CHECK (DECL))
  
  /* Access flags etc for a class (a TYPE_DECL): */
  
! #define CLASS_PUBLIC(DECL)	DECL_LANG_FLAG_1 (TYPE_DECL_CHECK (DECL))
! #define CLASS_FINAL(DECL)	DECL_FINAL (TYPE_DECL_CHECK (DECL))
! #define CLASS_INTERFACE(DECL)	DECL_LANG_FLAG_4 (TYPE_DECL_CHECK (DECL))
! #define CLASS_ABSTRACT(DECL)	DECL_LANG_FLAG_5 (TYPE_DECL_CHECK (DECL))
! #define CLASS_SUPER(DECL)	DECL_LANG_FLAG_6 (TYPE_DECL_CHECK (DECL))
! #define CLASS_STATIC(DECL)	DECL_LANG_FLAG_7 (TYPE_DECL_CHECK (DECL))
! #define CLASS_PRIVATE(DECL)	(TYPE_PRIVATE_INNER_CLASS (TREE_TYPE (DECL)))
! #define CLASS_PROTECTED(DECL)	(TYPE_PROTECTED_INNER_CLASS (TREE_TYPE (DECL)))
! #define CLASS_STRICTFP(DECL)	(TYPE_STRICTFP (TREE_TYPE (DECL)))
  #define CLASS_USES_ASSERTIONS(DECL) (TYPE_USES_ASSERTIONS (TREE_TYPE (DECL)))
  
*************** extern void gen_indirect_dispatch_tables
*** 1413,1418 ****
  
  /* The number of virtual methods in this class's dispatch table.
!  Does not include initial two dummy entries (one points to the
!  Class object, and the other is for G++ -fvtable-thunks compatibility). */
  #define TYPE_NVIRTUALS(TYPE) TYPE_BINFO_VIRTUALS (TYPE)
  
--- 1418,1423 ----
  
  /* The number of virtual methods in this class's dispatch table.
!    Does not include initial two dummy entries (one points to the
!    Class object, and the other is for G++ -fvtable-thunks compatibility). */
  #define TYPE_NVIRTUALS(TYPE) TYPE_BINFO_VIRTUALS (TYPE)
  
*************** extern tree *type_map;
*** 1483,1487 ****
  
  /* Map a stack index to the type currently in that slot. */
! #define stack_type_map (type_map+DECL_MAX_LOCALS(current_function_decl))
  
  /* True iff TYPE takes two variable/stack slots. */
--- 1488,1492 ----
  
  /* Map a stack index to the type currently in that slot. */
! #define stack_type_map (type_map + DECL_MAX_LOCALS (current_function_decl))
  
  /* True iff TYPE takes two variable/stack slots. */
*************** extern tree *type_map;
*** 1499,1507 ****
  
  /* If FUNCTION_TYPE or METHOD_TYPE: cache for build_java_argument_signature. */
! #define TYPE_ARGUMENT_SIGNATURE(TYPE) TYPE_VFIELD(TYPE)
  
  /* Given an array type, give the type of the elements. */
  /* FIXME this use of TREE_TYPE conflicts with something or other. */
! #define TYPE_ARRAY_ELEMENT(ATYPE) TREE_TYPE(ATYPE)
  
  /* True if class TYPE has been loaded (i.e. parsed plus laid out).
--- 1504,1513 ----
  
  /* If FUNCTION_TYPE or METHOD_TYPE: cache for build_java_argument_signature. */
! #define TYPE_ARGUMENT_SIGNATURE(TYPE) \
!   (TREE_CHECK2 (TYPE, FUNCTION_TYPE, METHOD_TYPE)->type.minval)
  
  /* Given an array type, give the type of the elements. */
  /* FIXME this use of TREE_TYPE conflicts with something or other. */
! #define TYPE_ARRAY_ELEMENT(ATYPE) TREE_TYPE (ATYPE)
  
  /* True if class TYPE has been loaded (i.e. parsed plus laid out).
*************** extern tree *type_map;
*** 1520,1525 ****
  
  /* True if class TYPE was requested (on command line) to be compiled.*/
! #define CLASS_FROM_CURRENTLY_COMPILED_P(TYPE) \
!   TYPE_LANG_FLAG_5 (TYPE)
  
  /* True if class TYPE is currently being laid out. Helps in detection
--- 1526,1530 ----
  
  /* True if class TYPE was requested (on command line) to be compiled.*/
! #define CLASS_FROM_CURRENTLY_COMPILED_P(TYPE) TYPE_LANG_FLAG_5 (TYPE)
  
  /* True if class TYPE is currently being laid out. Helps in detection
*************** extern tree *type_map;
*** 1553,1565 ****
  
  /* True if a SWITCH_EXPR has a DEFAULT_EXPR. */
! #define SWITCH_HAS_DEFAULT(NODE) TREE_LANG_FLAG_3 (NODE)
  
  /* True if EXPR (a WFL in that case) was created after the
     reduction of PRIMARY . XXX */
! #define PRIMARY_P(EXPR) TREE_LANG_FLAG_2 (EXPR)
  
  /* True if EXPR (a MODIFY_EXPR in that case) is the result of variable
     initialization during its declaration */
! #define MODIFY_EXPR_FROM_INITIALIZATION_P(EXPR) TREE_LANG_FLAG_2 (EXPR)
  
  /* True if EXPR (a TREE_TYPE denoting a class type) has its methods
--- 1558,1571 ----
  
  /* True if a SWITCH_EXPR has a DEFAULT_EXPR. */
! #define SWITCH_HAS_DEFAULT(NODE) TREE_LANG_FLAG_3 (SWITCH_EXPR_CHECK (NODE))
  
  /* True if EXPR (a WFL in that case) was created after the
     reduction of PRIMARY . XXX */
! #define PRIMARY_P(EXPR) TREE_LANG_FLAG_2 (EXPR_CHECK (EXPR))
  
  /* True if EXPR (a MODIFY_EXPR in that case) is the result of variable
     initialization during its declaration */
! #define MODIFY_EXPR_FROM_INITIALIZATION_P(EXPR) \
!   TREE_LANG_FLAG_2 (MODIFY_EXPR_CHECK (EXPR))
  
  /* True if EXPR (a TREE_TYPE denoting a class type) has its methods
*************** extern tree *type_map;
*** 1572,1586 ****
  
  /* True if EXPR (a LOOP_EXPR in that case) is part of a for statement */
! #define FOR_LOOP_P(EXPR) TREE_LANG_FLAG_0 (EXPR)
  
  /* True if NODE (a RECORD_TYPE in that case) is an anonymous class.  */
! #define ANONYMOUS_CLASS_P(NODE) TREE_LANG_FLAG_0 (NODE)
  
  /* True if NODE (a RECORD_TYPE in that case) is a block local class.  */
! #define LOCAL_CLASS_P(NODE) TREE_LANG_FLAG_1 (NODE)
  
  /* True if NODE (a TREE_LIST) hold a pair of argument name/type
     declared with the final modifier */
! #define ARG_FINAL_P(NODE) TREE_LANG_FLAG_0 (NODE)
  
  /* True if NODE (some kind of EXPR, but not a WFL) should not give an
--- 1578,1592 ----
  
  /* True if EXPR (a LOOP_EXPR in that case) is part of a for statement */
! #define FOR_LOOP_P(EXPR) TREE_LANG_FLAG_0 (EXPR_CHECK (EXPR))
  
  /* True if NODE (a RECORD_TYPE in that case) is an anonymous class.  */
! #define ANONYMOUS_CLASS_P(NODE) TREE_LANG_FLAG_0 (RECORD_TYPE_CHECK (NODE))
  
  /* True if NODE (a RECORD_TYPE in that case) is a block local class.  */
! #define LOCAL_CLASS_P(NODE) TREE_LANG_FLAG_1 (RECORD_TYPE_CHECK (NODE))
  
  /* True if NODE (a TREE_LIST) hold a pair of argument name/type
     declared with the final modifier */
! #define ARG_FINAL_P(NODE) TREE_LANG_FLAG_0 (TREE_LIST_CHECK (NODE))
  
  /* True if NODE (some kind of EXPR, but not a WFL) should not give an
*************** extern tree *type_map;
*** 1588,1598 ****
     to those EXPRs which can be used as the update expression of a
     `for' loop.  In particular it can't be set on a LOOP_EXPR.  */
! #define SUPPRESS_UNREACHABLE_ERROR(NODE) TREE_LANG_FLAG_0 (NODE)
  
  /* True if EXPR (a WFL in that case) resolves into a package name */
! #define RESOLVE_PACKAGE_NAME_P(WFL) TREE_LANG_FLAG_3 (WFL)
  
  /* True if EXPR (a WFL in that case) resolves into a type name */
! #define RESOLVE_TYPE_NAME_P(WFL) TREE_LANG_FLAG_4 (WFL)
  
  /* True if STMT (a WFL in that case) holds a BREAK statement */
--- 1594,1604 ----
     to those EXPRs which can be used as the update expression of a
     `for' loop.  In particular it can't be set on a LOOP_EXPR.  */
! #define SUPPRESS_UNREACHABLE_ERROR(NODE) TREE_LANG_FLAG_0 (EXPR_CHECK (NODE))
  
  /* True if EXPR (a WFL in that case) resolves into a package name */
! #define RESOLVE_PACKAGE_NAME_P(WFL) TREE_LANG_FLAG_3 (EXPR_CHECK (WFL))
  
  /* True if EXPR (a WFL in that case) resolves into a type name */
! #define RESOLVE_TYPE_NAME_P(WFL) TREE_LANG_FLAG_4 (EXPR_CHECK (WFL))
  
  /* True if STMT (a WFL in that case) holds a BREAK statement */
*************** extern tree *type_map;
*** 1604,1618 ****
  /* True if EXPR (a SAVE_EXPR in that case) had its content already
     checked for (un)initialized local variables.  */
! #define IS_INIT_CHECKED(EXPR) TREE_LANG_FLAG_5 (EXPR)
  
  /* If set in CALL_EXPR, the receiver is 'super'. */
! #define CALL_USING_SUPER(EXPR) TREE_LANG_FLAG_4 (EXPR)
  
  /* True if NODE (a statement) can complete normally. */
! #define CAN_COMPLETE_NORMALLY(NODE) TREE_LANG_FLAG_6(NODE)
  
  /* True if NODE (an IDENTIFIER) bears the name of a outer field from
     inner class access function.  */
! #define OUTER_FIELD_ACCESS_IDENTIFIER_P(NODE) TREE_LANG_FLAG_6(NODE)
  
  /* True if NODE belongs to an inner class TYPE_DECL node.
--- 1610,1625 ----
  /* True if EXPR (a SAVE_EXPR in that case) had its content already
     checked for (un)initialized local variables.  */
! #define IS_INIT_CHECKED(EXPR) TREE_LANG_FLAG_5 (SAVE_EXPR_CHECK (EXPR))
  
  /* If set in CALL_EXPR, the receiver is 'super'. */
! #define CALL_USING_SUPER(EXPR) TREE_LANG_FLAG_4 (EXPR_CHECK (EXPR))
  
  /* True if NODE (a statement) can complete normally. */
! #define CAN_COMPLETE_NORMALLY(NODE) TREE_LANG_FLAG_6 (NODE)
  
  /* True if NODE (an IDENTIFIER) bears the name of a outer field from
     inner class access function.  */
! #define OUTER_FIELD_ACCESS_IDENTIFIER_P(NODE) \
!   TREE_LANG_FLAG_6 (IDENTIFIER_NODE_CHECK (NODE))
  
  /* True if NODE belongs to an inner class TYPE_DECL node.
*************** extern tree *type_map;
*** 1653,1657 ****
  /* On a TYPE_DECL, hold the list of inner classes defined within the
     scope of TYPE_DECL.  */
! #define DECL_INNER_CLASS_LIST(NODE) DECL_INITIAL (NODE)
  
  /* Build a IDENTIFIER_NODE for a file name we're considering. Since
--- 1660,1664 ----
  /* On a TYPE_DECL, hold the list of inner classes defined within the
     scope of TYPE_DECL.  */
! #define DECL_INNER_CLASS_LIST(NODE) DECL_INITIAL (TYPE_DECL_CHECK (NODE))
  
  /* Build a IDENTIFIER_NODE for a file name we're considering. Since
*************** extern tree *type_map;
*** 1674,1718 ****
  
  #define PUSH_FIELD(RTYPE, FIELD, NAME, FTYPE) \
! { tree tmp_field = build_decl (FIELD_DECL, get_identifier(NAME), FTYPE); \
!   if (TYPE_FIELDS (RTYPE) == NULL_TREE) TYPE_FIELDS (RTYPE) = tmp_field; \
!   else TREE_CHAIN(FIELD) = tmp_field; \
!   DECL_CONTEXT (tmp_field) = RTYPE; \
!   DECL_ARTIFICIAL (tmp_field) = 1; \
!   FIELD = tmp_field; }
  
  #define FINISH_RECORD(RTYPE) layout_type (RTYPE)
  
  /* Start building a RECORD_TYPE constructor with a given TYPE in CONS. */
! #define START_RECORD_CONSTRUCTOR(CONS, CTYPE) { \
!   CONS = build_constructor (CTYPE, NULL_TREE);\
!   TREE_CHAIN(CONS) = TYPE_FIELDS (CTYPE); }
  
  /* Append a field initializer to CONS for the dummy field for the inherited
     fields.  The dummy field has the given VALUE, and the same type as the
     super-class.   Must be specified before calls to PUSH_FIELD_VALUE. */
! 
! #define PUSH_SUPER_VALUE(CONS, VALUE) {\
!   tree field = TREE_CHAIN(CONS);\
!   if (DECL_NAME (field) != NULL_TREE) abort();\
!   CONSTRUCTOR_ELTS(CONS) = tree_cons (field, VALUE, CONSTRUCTOR_ELTS(CONS));\
!   TREE_CHAIN(CONS) = TREE_CHAIN (field); }
  
  /* Append a field initializer to CONS for a field with the given VALUE.
     NAME is a char* string used for error checking;
     the initializer must be specified in order. */
! #define PUSH_FIELD_VALUE(CONS, NAME, VALUE) 					\
! do										\
! {										\
!   tree field = TREE_CHAIN(CONS);						\
!   if (strcmp (IDENTIFIER_POINTER (DECL_NAME (field)), NAME) != 0) 		\
!     abort();									\
!   CONSTRUCTOR_ELTS(CONS) = tree_cons (field, VALUE, CONSTRUCTOR_ELTS(CONS));	\
!   TREE_CHAIN(CONS) = TREE_CHAIN (field); 					\
! }										\
  while (0)
  
  /* Finish creating a record CONSTRUCTOR CONS. */
  #define FINISH_RECORD_CONSTRUCTOR(CONS) \
!   CONSTRUCTOR_ELTS(CONS) = nreverse (CONSTRUCTOR_ELTS(CONS))
  
  /* Macros on constructors invocations.  */
--- 1681,1731 ----
  
  #define PUSH_FIELD(RTYPE, FIELD, NAME, FTYPE) \
! { tree _field = build_decl (FIELD_DECL, get_identifier ((NAME)), (FTYPE)); \
!   if (TYPE_FIELDS (RTYPE) == NULL_TREE)	\
!     TYPE_FIELDS (RTYPE) = _field; 	\
!   else					\
!     TREE_CHAIN(FIELD) = _field;		\
!   DECL_CONTEXT (_field) = (RTYPE);	\
!   DECL_ARTIFICIAL (_field) = 1;		\
!   FIELD = _field; }
  
  #define FINISH_RECORD(RTYPE) layout_type (RTYPE)
  
  /* Start building a RECORD_TYPE constructor with a given TYPE in CONS. */
! #define START_RECORD_CONSTRUCTOR(CONS, CTYPE)	\
! { CONS = build_constructor ((CTYPE), NULL_TREE);	\
!   TREE_CHAIN (CONS) = TYPE_FIELDS (CTYPE); }
  
  /* Append a field initializer to CONS for the dummy field for the inherited
     fields.  The dummy field has the given VALUE, and the same type as the
     super-class.   Must be specified before calls to PUSH_FIELD_VALUE. */
! #define PUSH_SUPER_VALUE(CONS, VALUE)			\
! {							\
!   tree _field = TREE_CHAIN (CONS);			\
!   if (DECL_NAME (_field) != NULL_TREE)			\
!     abort ();						\
!   CONSTRUCTOR_ELTS (CONS)				\
!     = tree_cons (_field, (VALUE), CONSTRUCTOR_ELTS (CONS)); \
!   TREE_CHAIN (CONS) = TREE_CHAIN (_field);		\
! }
  
  /* Append a field initializer to CONS for a field with the given VALUE.
     NAME is a char* string used for error checking;
     the initializer must be specified in order. */
! #define PUSH_FIELD_VALUE(CONS, NAME, VALUE) 				\
! do									\
! {									\
!   tree _field = TREE_CHAIN (CONS);					\
!   if (strcmp (IDENTIFIER_POINTER (DECL_NAME (_field)), NAME) != 0) 	\
!     abort ();								\
!   CONSTRUCTOR_ELTS (CONS)						\
!     = tree_cons (_field, (VALUE), CONSTRUCTOR_ELTS (CONS));		\
!   TREE_CHAIN (CONS) = TREE_CHAIN (_field); 				\
! }									\
  while (0)
  
  /* Finish creating a record CONSTRUCTOR CONS. */
  #define FINISH_RECORD_CONSTRUCTOR(CONS) \
!   CONSTRUCTOR_ELTS(CONS) = nreverse (CONSTRUCTOR_ELTS (CONS))
  
  /* Macros on constructors invocations.  */
*************** while (0)
*** 1732,1742 ****
  
  /* Using a FINALLY_EXPR node */
! #define FINALLY_EXPR_LABEL(NODE) TREE_OPERAND ((NODE), 0)
! #define FINALLY_EXPR_BLOCK(NODE) TREE_OPERAND ((NODE), 1)
  
  #define BLOCK_EXPR_DECLS(NODE)  BLOCK_VARS(NODE)
  #define BLOCK_EXPR_BODY(NODE)   BLOCK_SUBBLOCKS(NODE)
  /* True for an implicit block surrounding declaration not at start of {...}. */
! #define BLOCK_IS_IMPLICIT(NODE) TREE_LANG_FLAG_1 (NODE)
  #define BLOCK_EMPTY_P(NODE) \
    (TREE_CODE (NODE) == BLOCK && BLOCK_EXPR_BODY (NODE) == empty_stmt_node)
--- 1745,1756 ----
  
  /* Using a FINALLY_EXPR node */
! #define FINALLY_EXPR_LABEL(NODE) TREE_OPERAND (FINALLY_EXPR_CHECK (NODE), 0)
! #define FINALLY_EXPR_BLOCK(NODE) TREE_OPERAND (FINALLY_EXPR_CHECK (NODE), 1)
  
  #define BLOCK_EXPR_DECLS(NODE)  BLOCK_VARS(NODE)
  #define BLOCK_EXPR_BODY(NODE)   BLOCK_SUBBLOCKS(NODE)
+ 
  /* True for an implicit block surrounding declaration not at start of {...}. */
! #define BLOCK_IS_IMPLICIT(NODE) TREE_LANG_FLAG_1 (BLOCK_CHECK (NODE))
  #define BLOCK_EMPTY_P(NODE) \
    (TREE_CODE (NODE) == BLOCK && BLOCK_EXPR_BODY (NODE) == empty_stmt_node)
*************** enum
*** 1798,1802 ****
  
    JV_STATE_DONE = 14		/* Must be last.  */
- 
  };
  
--- 1812,1815 ----
*** java/jcf-write.c	20 Dec 2003 15:38:27 -0000	1.140
--- java/jcf-write.c	18 Mar 2004 03:40:53 -0000
*************** get_access_flags (tree decl)
*** 634,641 ****
    int flags = 0;
    int isfield = TREE_CODE (decl) == FIELD_DECL || TREE_CODE (decl) == VAR_DECL;
!   if (CLASS_PUBLIC (decl))  /* same as FIELD_PUBLIC and METHOD_PUBLIC */
!     flags |= ACC_PUBLIC;
!   if (CLASS_FINAL (decl))  /* same as FIELD_FINAL and METHOD_FINAL */
!     flags |= ACC_FINAL;
    if (isfield || TREE_CODE (decl) == FUNCTION_DECL)
      {
--- 634,638 ----
    int flags = 0;
    int isfield = TREE_CODE (decl) == FIELD_DECL || TREE_CODE (decl) == VAR_DECL;
! 
    if (isfield || TREE_CODE (decl) == FUNCTION_DECL)
      {
*************** get_access_flags (tree decl)
*** 647,650 ****
--- 644,651 ----
    else if (TREE_CODE (decl) == TYPE_DECL)
      {
+       if (CLASS_PUBLIC (decl))
+ 	flags |= ACC_PUBLIC;
+       if (CLASS_FINAL (decl))
+ 	flags |= ACC_FINAL;
        if (CLASS_SUPER (decl))
  	flags |= ACC_SUPER;
*************** get_access_flags (tree decl)
*** 670,673 ****
--- 671,678 ----
    if (TREE_CODE (decl) == FUNCTION_DECL)
      {
+       if (METHOD_PUBLIC (decl))
+ 	flags |= ACC_PUBLIC;
+       if (METHOD_FINAL (decl))
+ 	flags |= ACC_FINAL;
        if (METHOD_NATIVE (decl))
  	flags |= ACC_NATIVE;
*************** get_access_flags (tree decl)
*** 683,686 ****
--- 688,695 ----
    if (isfield)
      {
+       if (FIELD_PUBLIC (decl))
+ 	flags |= ACC_PUBLIC;
+       if (FIELD_FINAL (decl))
+ 	flags |= ACC_FINAL;
        if (FIELD_STATIC (decl))
  	flags |= ACC_STATIC;
*** ada/ada-tree.h	13 Nov 2003 22:59:23 -0000	1.3.4.6
--- ada/ada-tree.h	18 Mar 2004 04:17:33 -0000
*************** struct lang_type GTY(())
*** 96,100 ****
  /* For RECORD_TYPE, UNION_TYPE, and QUAL_UNION_TYPE, nonzero if this denotes
     a left-justified modular type (will only be true for RECORD_TYPE).  */
! #define TYPE_LEFT_JUSTIFIED_MODULAR_P(NODE) TYPE_LANG_FLAG_1 (NODE)
  
  /* Nonzero in an arithmetic subtype if this is a subtype not known to the
--- 96,101 ----
  /* For RECORD_TYPE, UNION_TYPE, and QUAL_UNION_TYPE, nonzero if this denotes
     a left-justified modular type (will only be true for RECORD_TYPE).  */
! #define TYPE_LEFT_JUSTIFIED_MODULAR_P(NODE) \
!   TYPE_LANG_FLAG_1 (REC_OR_UNION_CHECK (NODE))
  
  /* Nonzero in an arithmetic subtype if this is a subtype not known to the
*************** struct lang_type GTY(())
*** 108,112 ****
     type for an object whose type includes its template in addition to
     its value (only true for RECORD_TYPE).  */
! #define TYPE_CONTAINS_TEMPLATE_P(NODE) TYPE_LANG_FLAG_3 (NODE)
  
  /* For INTEGER_TYPE, nonzero if this really represents a VAX
--- 109,114 ----
     type for an object whose type includes its template in addition to
     its value (only true for RECORD_TYPE).  */
! #define TYPE_CONTAINS_TEMPLATE_P(NODE) \
!   TYPE_LANG_FLAG_3 (REC_OR_UNION_CHECK (NODE))
  
  /* For INTEGER_TYPE, nonzero if this really represents a VAX
*************** struct lang_type GTY(())
*** 189,193 ****
  
  /* For INTEGER_TYPE, stores the RM_Size of the type.  */
! #define TYPE_RM_SIZE_INT(NODE)	TYPE_VALUES (INTEGER_TYPE_CHECK (NODE))
  
  /* Likewise for ENUMERAL_TYPE.  */
--- 191,195 ----
  
  /* For INTEGER_TYPE, stores the RM_Size of the type.  */
! #define TYPE_RM_SIZE_INT(NODE)	(INTEGER_TYPE_CHECK (NODE)->type.values)
  
  /* Likewise for ENUMERAL_TYPE.  */
*************** struct lang_type GTY(())
*** 225,230 ****
  
  /* In an UNCONSTRAINED_ARRAY_TYPE, points to the record containing both
!    the template and object.  */
! #define TYPE_OBJECT_RECORD_TYPE(NODE) TYPE_MIN_VALUE (NODE)
  
  /* Nonzero in a FUNCTION_DECL that represents a stubbed function
--- 227,237 ----
  
  /* In an UNCONSTRAINED_ARRAY_TYPE, points to the record containing both
!    the template and object.
! 
!    ??? We also put this on an ENUMERAL_TYPE that's dummy.  Technically,
!    this is a conflict on the minval field, but there doesn't seem to be
!    simple fix, so we'll live with this kludge for now.  */
! #define TYPE_OBJECT_RECORD_TYPE(NODE) \
!   (TREE_CHECK2 ((NODE), UNCONSTRAINED_ARRAY_TYPE, ENUMERAL_TYPE)->type.minval)
  
  /* Nonzero in a FUNCTION_DECL that represents a stubbed function
*************** struct lang_type GTY(())
*** 278,282 ****
  /* This is the loop id for a GNAT_LOOP_ID node.  */
  #define TREE_LOOP_ID(NODE) \
!   ((union lang_tree_node *) TREE_CHECK (NODE, GNAT_LOOP_ID))->loop_id.loop_id
  
  /* Define fields and macros for statements.
--- 285,289 ----
  /* This is the loop id for a GNAT_LOOP_ID node.  */
  #define TREE_LOOP_ID(NODE) \
!   ((union lang_tree_node *) GNAT_LOOP_ID_CHECK (NODE))->loop_id.loop_id
  
  /* Define fields and macros for statements.
*** ada/decl.c	10 Mar 2004 21:52:50 -0000	1.63.2.41
--- ada/decl.c	18 Mar 2004 04:17:38 -0000
*************** gnat_to_gnu_entity (Entity_Id gnat_entit
*** 1173,1177 ****
  	  }
  
! 	TYPE_FIELDS (gnu_type) = nreverse (gnu_literal_list);
  
  	/* Note that the bounds are updated at the end of this function
--- 1173,1177 ----
  	  }
  
! 	TYPE_VALUES (gnu_type) = nreverse (gnu_literal_list);
  
  	/* Note that the bounds are updated at the end of this function
*** ada/trans.c	6 Mar 2004 12:33:29 -0000	1.68.2.37
--- ada/trans.c	18 Mar 2004 04:17:58 -0000
*************** convert_with_check (Entity_Id gnat_type,
*** 4715,4722 ****
    tree gnu_base_type = get_base_type (gnu_type);
    tree gnu_ada_base_type = get_ada_base_type (gnu_type);
-   tree gnu_in_lb = TYPE_MIN_VALUE (gnu_in_basetype);
-   tree gnu_in_ub = TYPE_MAX_VALUE (gnu_in_basetype);
-   tree gnu_out_lb = TYPE_MIN_VALUE (gnu_base_type);
-   tree gnu_out_ub = TYPE_MAX_VALUE (gnu_base_type);
    tree gnu_result = gnu_expr;
  
--- 4715,4718 ----
*************** convert_with_check (Entity_Id gnat_type,
*** 4746,4749 ****
--- 4742,4749 ----
        tree gnu_input = protect_multiple_eval (gnu_result);
        tree gnu_cond = integer_zero_node;
+       tree gnu_in_lb = TYPE_MIN_VALUE (gnu_in_basetype);
+       tree gnu_in_ub = TYPE_MAX_VALUE (gnu_in_basetype);
+       tree gnu_out_lb = TYPE_MIN_VALUE (gnu_base_type);
+       tree gnu_out_ub = TYPE_MAX_VALUE (gnu_base_type);
  
        /* Convert the lower bounds to signed types, so we're sure we're


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