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]

[PCH] auto-generate marker routine for trees



This is the patch I've been building up to for months now.  It makes
the tree marker routine auto-generated.

It does have one known problem: It breaks Java.  Java has a hash table
reference in the lang_decl structure, and the generic machinery
doesn't know what to do about hash tables yet; that'll be my next task.

Also, I couldn't test it on Ada.  The only Ada compiler that I had
that worked to bootstrap with is now not functional.  I'd like to
encourage anyone who can test with Ada to try the branch and see if it
bootstraps.

Tested on x86-linux with gcac checking.

-- 
Geoff Keating <geoffk@redhat.com>

===File ~/patches/pchbranch-gttree-1.patch==================
Index: ChangeLog
2002-05-08  Geoffrey Keating  <geoffk@redhat.com>

	* Makefile.in (stringpool.o): Add $(GGC_H).
	(dwarf2asm.o): Likewise.
	(GTFILES): Add hashtable.h.
	* c-common.h (struct c_common_identifier): Use gengtype.
	* c-decl.h (c_mark_tree): Delete.
	* c-lang.c (LANG_HOOKS_MARK_TREE): Delete.
	* c-tree.h (struct lang_identifier): Use gengtype.
	(union lang_tree_node): New.
	(c_mark_tree): Delete prototype.
	* dwarf2out.c [!DWARF2_DEBUGGING_INFO]: Define dummy 
	dwarf2_debug_hooks.
	* gengtype-lex.l (IWORD): Allow 'bool'.
	(ptr_alias): Match.
	* gengtype-yacc.y (ALIAS): New token.
	(type_option): New rule.
	(option): Use type_option.
	* gengtype.c (process_gc_options): New.
	(set_gc_used_type): Use it.
	(write_gc_structure_fields): Add 'bitmap' parameter, change callers.
	Add new variable 't' to hold the type of the field being processed.
	Add more error checking.  Use UNION_P when looking at 'desc' option.
	Handle language-specific structures containing other
	language-specific structures.
	(write_gc_types): Handle 'ptr_alias' option.
	(main): Don't need to specially output lang_type, lang_decl, lang_id2.
	* ggc-common.c (ggc_pending_trees): Delete.
	(ggc_mark_roots): Don't manipulate ggc_pending_trees.
	(ggc_mark_trees): Delete.
	(gt_ggc_m_tree_node): Delete.
	* ggc.h (ggc_pending_trees): Delete.
	(ggc_mark_tree): Make alias of gt_ggc_m_tree_node.
	* hashtable.h (ht_identifier): Use gengtype.
	* langhooks-def.h (LANG_HOOKS_MARK_TREE): Delete.
	* langhooks.h (struct lang_hooks): Delete mark_tree.
	* sdbout.c [! SDB_DEBUGGING_INFO]: Define dummy sdb_debug_hooks
	anyway.
	* system.h: Poison LANG_HOOKS_MARK_TREE.
	* tree.c (tree_node_structure): New.
	* tree.h (struct tree_common): Use gengtype.
	(struct tree_int_cst): Likewise.
	(struct tree_real_cst): Likewise.
	(struct tree_string): Likewise.
	(struct tree_complex): Likewise.
	(struct tree_vector): Likewise.
	(struct tree_identifier): Likewise.
	(struct tree_list): Likewise.
	(struct tree_vec): Likewise.
	(struct tree_exp): Likewise.
	(struct tree_block): Likewise.
	(struct tree_type): Likewise.
	(struct tree_decl): Likewise.
	(enum tree_structure_enum): New.
	(union tree_node): Use gengtype, with an alias.
	(tree_node_structure): Prototype.
	* objc/objc-lang.c (LANG_HOOKS_MARK_TREE): Delete.

Index: ada/ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/ChangeLog,v
retrieving revision 1.194.6.6
diff -p -u -p -r1.194.6.6 ChangeLog
--- ada/ChangeLog	6 May 2002 18:46:09 -0000	1.194.6.6
+++ ada/ChangeLog	8 May 2002 09:10:05 -0000
@@ -1,5 +1,17 @@
2002-05-08  Geoffrey Keating  <geoffk@redhat.com>

	* ada-tree.h: Update all macros for new tree description.
	(struct tree_loop_id): New.
	(union lang_tree_node): New.
	(struct lang_decl): New.
	(struct lang_type): New.
	* misc.c (gnat_mark_tree): Delete.
	(LANG_HOOKS_MARK_TREE): Delete.
	* trans.c (tree_transform): No longer any need to cast
	for TREE_LOOP_ID.

Index: cp/ChangeLog
2002-05-08  Geoffrey Keating  <geoffk@redhat.com>

	* Make-lang.in (cp/decl.o): Add debug.h dependency.
	* call.c (struct z_candidate): Use gengtype.
	(USER_CONV_CAND): Use WRAPPER_ZC.
	(convert_class_to_reference): Use build_zc_wrapper.
	(build_type_conversion_1): Likewise.
	(build_over_call): Use WRAPPER_ZC.
	(add_warning): Use build_zc_wrapper.
	* cp-lang.c (LANG_HOOKS_MARK_TREE): Delete.
	* cp-tree.h (struct lang_identifier): Use gengtype.
	(struct template_parm_index_s): Likewise.
	(struct ptrmem_cst): Likewise.
	(struct tree_binding): Likewise.
	(struct tree_overload): Likewise.
	(struct tree_srcloc): Likewise.
	(struct tree_wrapper): Likewise.  Also modify to have a pointer
	to struct z_candidate rather than void.
	(enum cp_tree_node_structure_enum): New.
	(union lang_tree_node): New.
	(cxx_mark_tree): Delete prototype.
	(cp_tree_node_structure): New prototype.
	(build_ptr_wrapper): Delete prototype.
	(build_int_wrapper): Delete prototype.
	(build_zc_wrapper): New prototype.
	* decl.c: Include debug.h
	(cxx_mark_tree): Delete.
	(cp_tree_node_structure): New.
	* tree.c (build_ptr_wrapper): Delete.
	(build_int_wrapper): Delete.
	(build_zc_wrapper): New.

Index: f/ChangeLog
Wed May  8 01:57:25 2002  Geoffrey Keating  <geoffk@redhat.com>

	* Make-lang.in (f/com.o): Depend on debug.h.
	* com.c: Include debug.h.
	(LANG_HOOKS_MARK_TREE): Delete.
	(struct lang_identifier): Use gengtype.
	(union lang_tree_node): New.
	(struct lang_decl): New dummy definition.
	(struct lang_type): New dummy definition.
	(ffe_mark_tree): Delete.

Index: java/ChangeLog
2002-05-08  Geoffrey Keating  <geoffk@redhat.com>

	* Make-lang.in (java/parse.o): Depend on debug.h.
	* java-tree.h (struct lang_identifier): Use gengtype.
	(union lang_tree_node): New.
	(struct lang_decl_func): Use gengtype.
	(struct lang_decl_var): Likewise.
	(struct lang_decl): Likewise.
	* parse.y: Include debug.h.
	* lang.c (LANG_HOOKS_MARK_TREE): Delete.

Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.822.2.12
diff -p -u -p -r1.822.2.12 Makefile.in
--- Makefile.in	6 May 2002 18:42:59 -0000	1.822.2.12
+++ Makefile.in	8 May 2002 09:10:01 -0000
@@ -1343,7 +1343,7 @@ ggc-page.o: ggc-page.c $(CONFIG_H) $(SYS
 	toplev.h $(GGC_H) varray.h $(TIMEVAR_H) $(TM_P_H)
 
 stringpool.o: stringpool.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(OBSTACK_H) \
-	flags.h toplev.h
+	flags.h toplev.h $(GGC_H)
 
 hashtable.o: hashtable.c hashtable.h $(CONFIG_H) $(SYSTEM_H) $(OBSTACK_H)
 
@@ -1475,7 +1475,7 @@ dwarf2out.o : dwarf2out.c $(CONFIG_H) $(
    hard-reg-set.h $(REGS_H) $(EXPR_H) libfuncs.h toplev.h dwarf2out.h varray.h \
    $(GGC_H) except.h dwarf2asm.h $(TM_P_H) langhooks.h
 dwarf2asm.o : dwarf2asm.c $(CONFIG_H) $(SYSTEM_H) flags.h $(RTL_H) $(TREE_H) \
-   output.h dwarf2asm.h $(TM_P_H)
+   output.h dwarf2asm.h $(TM_P_H) $(GGC_H)
 vmsdbgout.o : vmsdbgout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) flags.h \
    output.h vmsdbg.h debug.h langhooks.h
 xcoffout.o : xcoffout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) xcoffout.h \
@@ -1823,7 +1823,7 @@ s-preds: genpreds$(build_exeext) $(srcdi
 
 GTFILES = $(GCONFIG_H) \
   $(srcdir)/bitmap.h $(srcdir)/function.h  $(srcdir)/rtl.h $(srcdir)/optabs.h \
-  $(srcdir)/tree.h $(srcdir)/libfuncs.h \
+  $(srcdir)/tree.h $(srcdir)/libfuncs.h $(srcdir)/hashtable.h \
   $(srcdir)/c-common.h $(srcdir)/c-tree.h \
   $(srcdir)/alias.c $(srcdir)/cselib.c $(srcdir)/emit-rtl.c \
   $(srcdir)/except.c $(srcdir)/explow.c $(srcdir)/expr.c \
Index: c-common.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-common.h,v
retrieving revision 1.112.4.7
diff -p -u -p -r1.112.4.7 c-common.h
--- c-common.h	6 May 2002 18:43:08 -0000	1.112.4.7
+++ c-common.h	8 May 2002 09:10:01 -0000
@@ -183,10 +183,10 @@ enum c_tree_index
 
 /* Identifier part common to the C front ends.  Inherits from
    tree_identifier, despite appearances.  */
-struct c_common_identifier
+struct c_common_identifier GTY(())
 {
   struct tree_common common;
-  struct cpp_hashnode node;
+  struct cpp_hashnode GTY ((skip (""))) node;
 };
 
 #define wchar_type_node			c_global_trees[CTI_WCHAR_TYPE]
Index: c-decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-decl.c,v
retrieving revision 1.288.2.10
diff -p -u -p -r1.288.2.10 c-decl.c
--- c-decl.c	6 May 2002 18:43:10 -0000	1.288.2.10
+++ c-decl.c	8 May 2002 09:10:02 -0000
@@ -7030,28 +7030,6 @@ c_dup_lang_specific_decl (decl)
   DECL_LANG_SPECIFIC (decl) = ld;
 }
 
-/* Mark the language specific bits in T for GC.  */
-
-void
-c_mark_tree (t)
-     tree t;
-{
-  if (TREE_CODE (t) == IDENTIFIER_NODE)
-    {
-      struct lang_identifier *i = (struct lang_identifier *) t;
-      ggc_mark_tree (i->global_value);
-      ggc_mark_tree (i->local_value);
-      ggc_mark_tree (i->label_value);
-      ggc_mark_tree (i->implicit_decl);
-      ggc_mark_tree (i->error_locus);
-      ggc_mark_tree (i->limbo_value);
-    }
-  else if (TYPE_P (t))
-    gt_ggc_m_lang_type (TYPE_LANG_SPECIFIC (t));
-  else if (DECL_P (t))
-    gt_ggc_m_lang_decl (DECL_LANG_SPECIFIC (t));
-}
-
 /* The functions below are required for functionality of doing
    function at once processing in the C front end. Currently these
    functions are not called from anywhere in the C front end, but as
Index: c-lang.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-lang.c,v
retrieving revision 1.74.4.3
diff -p -u -p -r1.74.4.3 c-lang.c
--- c-lang.c	6 May 2002 18:43:12 -0000	1.74.4.3
+++ c-lang.c	8 May 2002 09:10:02 -0000
@@ -50,8 +50,6 @@ static void c_post_options PARAMS ((void
 #define LANG_HOOKS_GET_ALIAS_SET c_common_get_alias_set
 #undef LANG_HOOKS_SAFE_FROM_P
 #define LANG_HOOKS_SAFE_FROM_P c_safe_from_p
-#undef LANG_HOOKS_MARK_TREE
-#define LANG_HOOKS_MARK_TREE c_mark_tree
 #undef LANG_HOOKS_EXPAND_EXPR
 #define LANG_HOOKS_EXPAND_EXPR c_expand_expr
 #undef LANG_HOOKS_MARK_ADDRESSABLE
Index: c-tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-tree.h,v
retrieving revision 1.80.2.7
diff -p -u -p -r1.80.2.7 c-tree.h
--- c-tree.h	6 May 2002 18:43:18 -0000	1.80.2.7
+++ c-tree.h	8 May 2002 09:10:02 -0000
@@ -34,11 +34,26 @@ Software Foundation, 59 Temple Place - S
    lang_identifier nodes, because some keywords are only special in a
    particular context.  */
 
-struct lang_identifier
+struct lang_identifier GTY(())
 {
-  struct c_common_identifier ignore;
-  tree global_value, local_value, label_value, implicit_decl;
-  tree error_locus, limbo_value;
+  struct c_common_identifier common_id;
+  tree global_value;
+  tree local_value;
+  tree label_value;
+  tree implicit_decl;
+  tree error_locus;
+  tree limbo_value;
+};
+
+/* The resulting tree type.  */
+
+union lang_tree_node 
+  GTY((desc ("TREE_CODE (&%h.generic) == IDENTIFIER_NODE")))
+{
+  union tree_node GTY ((tag ("0"), 
+			desc ("tree_node_structure (&%h)"))) 
+    generic;
+  struct lang_identifier GTY ((tag ("1"))) identifier;
 };
 
 /* Language-specific declaration information.  */
@@ -178,7 +193,6 @@ extern void c_insert_default_attributes	
 extern void c_init_decl_processing		PARAMS ((void));
 extern void c_dup_lang_specific_decl		PARAMS ((tree));
 extern void c_print_identifier			PARAMS ((FILE *, tree, int));
-extern void c_mark_tree				PARAMS ((tree));
 extern tree build_array_declarator              PARAMS ((tree, tree, int, int));
 extern tree build_enumerator                    PARAMS ((tree, tree));
 extern int  c_decode_option                     PARAMS ((int, char **));
Index: dwarf2out.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dwarf2out.c,v
retrieving revision 1.349.2.4
diff -p -u -p -r1.349.2.4 dwarf2out.c
--- dwarf2out.c	6 May 2002 18:43:54 -0000	1.349.2.4
+++ dwarf2out.c	8 May 2002 09:10:04 -0000
@@ -12301,4 +12301,9 @@ dwarf2out_finish (input_filename)
   if (debug_str_hash)
     ht_forall (debug_str_hash, output_indirect_string, NULL);
 }
-#endif /* DWARF2_DEBUGGING_INFO || DWARF2_UNWIND_INFO */
+#else
+
+/* This should never be used, but its address is needed for comparisons.  */
+const struct gcc_debug_hooks dwarf2_debug_hooks;
+
+#endif /* DWARF2_DEBUGGING_INFO */
Index: gengtype-lex.l
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/gengtype-lex.l,v
retrieving revision 1.1.2.6
diff -p -u -p -r1.1.2.6 gengtype-lex.l
--- gengtype-lex.l	3 May 2002 18:02:23 -0000	1.1.2.6
+++ gengtype-lex.l	8 May 2002 09:10:04 -0000
@@ -49,7 +49,7 @@ update_lineno (l, len)
 
 ID	[[:alpha:]][[:alnum:]_]*
 WS	[[:space:]]+
-IWORD	short|long|(un)?signed|char|int|HOST_WIDE_INT
+IWORD	short|long|(un)?signed|char|int|HOST_WIDE_INT|bool
 ITYPE	{IWORD}({WS}{IWORD})*
 
 %x in_struct in_struct_comment in_comment in_yacc_escape
@@ -187,6 +187,7 @@ ITYPE	{IWORD}({WS}{IWORD})*
 "union"/[^[:alnum:]_]		{ return UNION; }
 "struct"/[^[:alnum:]_]		{ return STRUCT; }
 "enum"/[^[:alnum:]_]		{ return ENUM; }
+"ptr_alias"/[^[:alnum:]_]	{ return ALIAS; }
 [0-9]+				{ return NUM; }
 
 {IWORD}({WS}{IWORD})*/[^[:alnum:]_]		|
Index: gengtype-yacc.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/gengtype-yacc.y,v
retrieving revision 1.1.2.7
diff -p -u -p -r1.1.2.7 gengtype-yacc.y
--- gengtype-yacc.y	3 May 2002 18:02:24 -0000	1.1.2.7
+++ gengtype-yacc.y	8 May 2002 09:10:04 -0000
@@ -41,6 +41,7 @@ Software Foundation, 59 Temple Place - S
 %token UNION "union"
 %token STRUCT "struct"
 %token ENUM "enum"
+%token ALIAS "ptr_alias"
 %token VARRAY_TYPE "varray_type"
 %token NUM
 %token PERCENTPERCENT "%%"
@@ -54,6 +55,7 @@ Software Foundation, 59 Temple Place - S
 %type <p> struct_fields yacc_ids yacc_typematch
 %type <t> type lasttype
 %type <o> optionsopt options option optionseq optionseqopt
+%type <s> type_option
 
 %%
 
@@ -254,10 +256,15 @@ optionsopt: { $$ = NULL; }
 
 options: GTY_TOKEN '(' '(' optionseqopt ')' ')' { $$ = $4; }
 
-option:	VARRAY_TYPE '(' type ')'
+type_option : VARRAY_TYPE
+	        { $$ = "varray_type"; }
+	      | ALIAS
+	        { $$ = "ptr_alias"; }
+
+option:	type_option '(' type ')'
 	   {
 	     options_p o = xmalloc (sizeof (*o));
-	     o->name = "varray_type";
+	     o->name = $1;
 	     o->info = $3;
 	     $$ = o;
 	   }
Index: gengtype.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/gengtype.c,v
retrieving revision 1.1.2.14
diff -p -u -p -r1.1.2.14 gengtype.c
--- gengtype.c	6 May 2002 18:44:19 -0000	1.1.2.14
+++ gengtype.c	8 May 2002 09:10:04 -0000
@@ -337,10 +337,27 @@ note_yacc_type (o, fields, typeinfo, pos
   do_typedef ("YYSTYPE", find_structure ("yy_union", 1), pos);
 }
 
+static void process_gc_options PARAMS ((options_p, enum gc_used_enum, int *));
 static void set_gc_used_type PARAMS ((type_p, enum gc_used_enum));
 static void set_gc_used PARAMS ((pair_p));
 
 static void
+process_gc_options (opt, level, maybe_undef)
+     options_p opt;
+     enum gc_used_enum level;
+     int *maybe_undef;
+{
+  options_p o;
+  for (o = opt; o; o = o->next)
+    if (strcmp (o->name, "ptr_alias") == 0 && level == GC_POINTED_TO)
+      set_gc_used_type ((type_p) o->info, GC_POINTED_TO);
+    else if (strcmp (o->name, "varray_type") == 0)
+      set_gc_used_type ((type_p) o->info, GC_POINTED_TO);
+    else if (strcmp (o->name, "maybe_undef") == 0)
+      *maybe_undef = 1;
+}
+
+static void
 set_gc_used_type (t, level)
      type_p t;
      enum gc_used_enum level;
@@ -356,14 +373,14 @@ set_gc_used_type (t, level)
     case TYPE_UNION:
       {
 	pair_p f;
+	int dummy;
+
+	process_gc_options (t->u.s.opt, level, &dummy);
+
 	for (f = t->u.s.fields; f; f = f->next)
 	  {
-	    options_p o;
 	    int maybe_undef = 0;
-	    
-	    for (o = f->opt; o; o = o->next)
-	      if (strcmp (o->name, "maybe_undef") == 0)
-		maybe_undef = 1;
+	    process_gc_options (t->u.s.opt, level, &maybe_undef);
 	    
 	    if (maybe_undef && f->type->kind == TYPE_POINTER)
 	      set_gc_used_type (f->type->u.p, GC_MAYBE_POINTED_TO);
@@ -730,7 +747,7 @@ close_output_files PARAMS ((void))
 
 static void write_gc_structure_fields 
   PARAMS ((FILE *, type_p, const char *, const char *, options_p, 
-	   int, struct fileloc *));
+	   int, struct fileloc *, lang_bitmap));
 static void write_gc_marker_routine_for_structure PARAMS ((type_p));
 static void write_gc_types PARAMS ((type_p structures));
 static void put_mangled_filename PARAMS ((FILE *, const char *));
@@ -741,7 +758,7 @@ static void write_gc_roots PARAMS ((pair
 static int gc_counter;
 
 static void
-write_gc_structure_fields (of, s, val, prev_val, opts, indent, line)
+write_gc_structure_fields (of, s, val, prev_val, opts, indent, line, bitmap)
      FILE *of;
      type_p s;
      const char *val;
@@ -749,13 +766,19 @@ write_gc_structure_fields (of, s, val, p
      options_p opts;
      int indent;
      struct fileloc *line;
+     lang_bitmap bitmap;
 {
   pair_p f;
   int tagcounter = -1;
 
   if (! s->u.s.line.file)
     error_at_line (line, "incomplete structure `%s'", s->u.s.tag);
-
+  else if ((s->u.s.bitmap & bitmap) != bitmap)
+    {
+      error_at_line (line, "structure defined for mismatching languages");
+      error_at_line (&s->u.s.line, "one structure defined here");
+    }
+  
   if (s->kind == TYPE_UNION)
     {
       const char *tagexpr = NULL;
@@ -766,6 +789,11 @@ write_gc_structure_fields (of, s, val, p
       for (oo = opts; oo; oo = oo->next)
 	if (strcmp (oo->name, "desc") == 0)
 	  tagexpr = (const char *)oo->info;
+      if (tagexpr == NULL)
+	{
+	  tagexpr = "1";
+	  error_at_line (line, "missing `desc' option");
+	}
 
       fprintf (of, "%*s{\n", indent, "");
       indent += 2;
@@ -794,10 +822,11 @@ write_gc_structure_fields (of, s, val, p
       int always_p = 0;
       int maybe_undef_p = 0;
       options_p oo;
+      type_p t = f->type;
       
-      if (f->type->kind == TYPE_SCALAR
-	  || (f->type->kind == TYPE_ARRAY 
-	      && f->type->u.a.p->kind == TYPE_SCALAR))
+      if (t->kind == TYPE_SCALAR
+	  || (t->kind == TYPE_ARRAY 
+	      && t->u.a.p->kind == TYPE_SCALAR))
 	continue;
       
       for (oo = f->opt; oo; oo = oo->next)
@@ -813,20 +842,20 @@ write_gc_structure_fields (of, s, val, p
 	  skip_p = 1;
 	else if (strcmp (oo->name, "always") == 0)
 	  always_p = 1;
-	else if (strcmp (oo->name, "desc") == 0 && f->type->kind == TYPE_UNION)
+	else if (strcmp (oo->name, "desc") == 0 && UNION_P (t))
 	  ;
 	else if (strcmp (oo->name, "descbits") == 0 
-		 && f->type->kind == TYPE_UNION)
+		 && t->kind == TYPE_UNION)
 	  ;
 	else
-	  error_at_line (&f->line, "unknown option `%s'\n", oo->name);
+	  error_at_line (&f->line, "unknown field option `%s'\n", oo->name);
 
       if (skip_p)
 	continue;
 
       if (maybe_undef_p
-	  && (f->type->kind != TYPE_POINTER
-	      || f->type->u.p->kind != TYPE_STRUCT))
+	  && (t->kind != TYPE_POINTER
+	      || t->u.p->kind != TYPE_STRUCT))
 	error_at_line (&f->line, 
 		       "field `%s' has invalid option `maybe_undef_p'\n",
 		       f->name);
@@ -842,12 +871,29 @@ write_gc_structure_fields (of, s, val, p
 	  indent += 2;
 	}
       
-      switch (f->type->kind)
+      switch (t->kind)
 	{
 	case TYPE_STRING:
 	  /* Do nothing; strings go in the string pool.  */
 	  break;
 
+	case TYPE_LANG_STRUCT:
+	  {
+	    type_p ti;
+	    for (ti = t->u.s.lang_struct; ti; ti = ti->next)
+	      if (ti->u.s.bitmap & bitmap)
+		{
+		  t = ti;
+		  break;
+		}
+	    if (ti == NULL)
+	      {
+		error_at_line (&f->line, 
+			       "structure not defined for this language");
+		break;
+	      }
+	  }
+	  /* Fall through... */
 	case TYPE_STRUCT:
 	case TYPE_UNION:
 	  {
@@ -855,8 +901,8 @@ write_gc_structure_fields (of, s, val, p
 
 	    newval = xmalloc (strlen (val) + sizeof (".") + strlen (f->name));
 	    sprintf (newval, "%s.%s", val, f->name);
-	    write_gc_structure_fields (of, f->type, newval, val,
-				       f->opt, indent, &f->line);
+	    write_gc_structure_fields (of, t, newval, val,
+				       f->opt, indent, &f->line, bitmap);
 	    free (newval);
 	    break;
 	  }
@@ -865,20 +911,20 @@ write_gc_structure_fields (of, s, val, p
 	  if (! length)
 	    {
 	      if (maybe_undef_p
-		  && f->type->u.p->u.s.line.file == NULL)
+		  && t->u.p->u.s.line.file == NULL)
 		fprintf (of, "%*sif (%s.%s) abort();\n", indent, "",
 			 val, f->name);
-	      else if (f->type->u.p->kind == TYPE_STRUCT
-		       || f->type->u.p->kind == TYPE_UNION
-		       || f->type->u.p->kind == TYPE_LANG_STRUCT)
+	      else if (t->u.p->kind == TYPE_STRUCT
+		       || t->u.p->kind == TYPE_UNION
+		       || t->u.p->kind == TYPE_LANG_STRUCT)
 		fprintf (of, "%*sgt_ggc_m_%s (%s.%s);\n", indent, "", 
-			 f->type->u.p->u.s.tag, val, f->name);
+			 t->u.p->u.s.tag, val, f->name);
 	      else
 		error_at_line (&f->line, "field `%s' is pointer to scalar",
 			       f->name);
 	      break;
 	    }
-	  else if (f->type->u.p->kind == TYPE_SCALAR)
+	  else if (t->u.p->kind == TYPE_SCALAR)
 	    fprintf (of, "%*sggc_mark (%s.%s);\n", indent, "", 
 		     val, f->name);
 	  else
@@ -901,7 +947,7 @@ write_gc_structure_fields (of, s, val, p
 		  fprintf (of, "(%s)", val);
 	      fprintf (of, "); i%d++) {\n", loopcounter);
 	      indent += 2;
-	      switch (f->type->u.p->kind)
+	      switch (t->u.p->kind)
 		{
 		case TYPE_STRUCT:
 		case TYPE_UNION:
@@ -910,16 +956,17 @@ write_gc_structure_fields (of, s, val, p
 		    
 		    newval = xmalloc (strlen (val) + 8 + strlen (f->name));
 		    sprintf (newval, "%s.%s[i%d]", val, f->name, loopcounter);
-		    write_gc_structure_fields (of, f->type->u.p, newval, val,
-					       f->opt, indent, &f->line);
+		    write_gc_structure_fields (of, t->u.p, newval, val,
+					       f->opt, indent, &f->line,
+					       bitmap);
 		    free (newval);
 		    break;
 		  }
 		case TYPE_POINTER:
-		  if (f->type->u.p->u.p->kind == TYPE_STRUCT
-		      || f->type->u.p->u.p->kind == TYPE_UNION)
+		  if (t->u.p->u.p->kind == TYPE_STRUCT
+		      || t->u.p->u.p->kind == TYPE_UNION)
 		    fprintf (of, "%*sgt_ggc_m_%s (%s.%s[i%d]);\n", indent, "", 
-			     f->type->u.p->u.p->u.s.tag, val, f->name,
+			     t->u.p->u.p->u.s.tag, val, f->name,
 			     loopcounter);
 		  else
 		    error_at_line (&f->line, 
@@ -940,13 +987,13 @@ write_gc_structure_fields (of, s, val, p
 	  break;
 
 	case TYPE_VARRAY:
-	  if (f->type->u.p->kind == TYPE_SCALAR)
+	  if (t->u.p->kind == TYPE_SCALAR)
 	    ;
-	  else if (f->type->u.p->kind == TYPE_POINTER
-		   && (f->type->u.p->u.p->kind == TYPE_STRUCT
-		       || f->type->u.p->u.p->kind == TYPE_UNION))
+	  else if (t->u.p->kind == TYPE_POINTER
+		   && (t->u.p->u.p->kind == TYPE_STRUCT
+		       || t->u.p->u.p->kind == TYPE_UNION))
 	    {
-	      const char *name = f->type->u.p->u.p->u.s.tag;
+	      const char *name = t->u.p->u.p->u.s.tag;
 	      if (strcmp (name, "rtx_def") == 0)
 		fprintf (of, "%*sggc_mark_rtx_varray (%s.%s);\n",
 			 indent, "", val, f->name);
@@ -967,20 +1014,20 @@ write_gc_structure_fields (of, s, val, p
 	case TYPE_ARRAY:
 	  {
 	    int loopcounter = ++gc_counter;
-	    type_p t;
+	    type_p ta;
 	    int i;
 
 	    if (! length &&
-		(strcmp (f->type->u.a.len, "0") == 0
-		 || strcmp (f->type->u.a.len, "1") == 0))
+		(strcmp (t->u.a.len, "0") == 0
+		 || strcmp (t->u.a.len, "1") == 0))
 	      error_at_line (&f->line, 
 			     "field `%s' is array of size %s",
-			     f->name, f->type->u.a.len);
+			     f->name, t->u.a.len);
 	    
 	    /* Arrays of scalars can be ignored.  */
-	    for (t = f->type; t->kind == TYPE_ARRAY; t = t->u.a.p)
+	    for (ta = t; ta->kind == TYPE_ARRAY; ta = ta->u.a.p)
 	      ;
-	    if (t->kind == TYPE_SCALAR)
+	    if (ta->kind == TYPE_SCALAR)
 	      break;
 
 	    fprintf (of, "%*s{\n", indent, "");
@@ -1001,7 +1048,7 @@ write_gc_structure_fields (of, s, val, p
 		length = "first_rtl_op (TREE_CODE ((tree)&%))";
 	      }
 
-	    for (t = f->type, i=0; t->kind == TYPE_ARRAY; t = t->u.a.p, i++)
+	    for (ta = t, i = 0; ta->kind == TYPE_ARRAY; ta = ta->u.a.p, i++)
 	      {
 		const char *p;
 		fprintf (of, "%*ssize_t i%d_%d;\n", 
@@ -1017,11 +1064,11 @@ write_gc_structure_fields (of, s, val, p
 			fprintf (of, "(%s)", val);
 		  }
 		else
-		  fputs (t->u.a.len, of);
+		  fputs (ta->u.a.len, of);
 		fputs (");\n", of);
 	      }
 		
-	    for (t = f->type, i=0; t->kind == TYPE_ARRAY; t = t->u.a.p, i++)
+	    for (ta = t, i = 0; ta->kind == TYPE_ARRAY; ta = ta->u.a.p, i++)
 	      {
 		fprintf (of, 
 		 "%*sfor (i%d_%d = 0; i%d_%d < ilimit%d_%d; i%d_%d++) {\n",
@@ -1030,43 +1077,43 @@ write_gc_structure_fields (of, s, val, p
 		indent += 2;
 	      }
 
-	    if (t->kind == TYPE_POINTER
-		&& (t->u.p->kind == TYPE_STRUCT
-		    || t->u.p->kind == TYPE_UNION))
+	    if (ta->kind == TYPE_POINTER
+		&& (ta->u.p->kind == TYPE_STRUCT
+		    || ta->u.p->kind == TYPE_UNION))
 	      {
 		fprintf (of, "%*sgt_ggc_m_%s (%s.%s", 
-			 indent, "", t->u.p->u.s.tag, val, f->name);
-		for (t = f->type, i=0; 
-		     t->kind == TYPE_ARRAY; 
-		     t = t->u.a.p, i++)
+			 indent, "", ta->u.p->u.s.tag, val, f->name);
+		for (ta = t, i = 0; 
+		     ta->kind == TYPE_ARRAY; 
+		     ta = ta->u.a.p, i++)
 		  fprintf (of, "[i%d_%d]", loopcounter, i);
 		fputs (");\n", of);
 	      }
-	    else if (t->kind == TYPE_STRUCT || t->kind == TYPE_UNION)
+	    else if (ta->kind == TYPE_STRUCT || ta->kind == TYPE_UNION)
 	      {
 		char *newval;
 		int len;
 		
 		len = strlen (val) + strlen (f->name) + 2;
-		for (t = f->type; t->kind == TYPE_ARRAY; t = t->u.a.p)
+		for (ta = t; ta->kind == TYPE_ARRAY; ta = ta->u.a.p)
 		  len += sizeof ("[i_]") + 2*6;
 		
 		newval = xmalloc (len);
 		sprintf (newval, "%s.%s", val, f->name);
-		for (t = f->type, i=0; 
-		     t->kind == TYPE_ARRAY; 
-		     t = t->u.a.p, i++)
+		for (ta = t, i = 0; 
+		     ta->kind == TYPE_ARRAY; 
+		     ta = ta->u.a.p, i++)
 		  sprintf (newval + strlen (newval), "[i%d_%d]", 
 			   loopcounter, i);
-		write_gc_structure_fields (of, f->type->u.p, newval, val,
-					   f->opt, indent, &f->line);
+		write_gc_structure_fields (of, t->u.p, newval, val,
+					   f->opt, indent, &f->line, bitmap);
 		free (newval);
 	      }
 	    else
 	      error_at_line (&f->line, 
 			     "field `%s' is array of unimplemented type",
 			     f->name);
-	    for (t = f->type, i=0; t->kind == TYPE_ARRAY; t = t->u.a.p, i++)
+	    for (ta = t, i = 0; ta->kind == TYPE_ARRAY; ta = ta->u.a.p, i++)
 	      {
 		indent -= 2;
 		fprintf (of, "%*s}\n", indent, "");
@@ -1128,7 +1175,7 @@ write_gc_marker_routine_for_structure (s
   
   gc_counter = 0;
   write_gc_structure_fields (f, s, "(*x)", "not valid postage",
-			     s->u.s.opt, 2, &s->u.s.line);
+			     s->u.s.opt, 2, &s->u.s.line, s->u.s.bitmap);
   
   fputs ("}\n", f);
 }
@@ -1145,10 +1192,30 @@ write_gc_types (structures)
     if (s->gc_used == GC_POINTED_TO
 	|| s->gc_used == GC_MAYBE_POINTED_TO)
       {
+	options_p opt;
+	
 	if (s->gc_used == GC_MAYBE_POINTED_TO
 	    && s->u.s.line.file == NULL)
 	  continue;
 
+	for (opt = s->u.s.opt; opt; opt = opt->next)
+	  if (strcmp (opt->name, "ptr_alias") == 0)
+	    {
+	      type_p t = (type_p) opt->info;
+	      if (t->kind == TYPE_STRUCT 
+		  || t->kind == TYPE_UNION
+		  || t->kind == TYPE_LANG_STRUCT)
+		fprintf (header_file,
+			 "#define gt_ggc_m_%s gt_ggc_m_%s\n",
+			 s->u.s.tag, t->u.s.tag);
+	      else
+		error_at_line (&s->u.s.line, 
+			       "structure alias is not a structure");
+	      break;
+	    }
+	if (opt)
+	  continue;
+
 	/* Declare the marker procedure only once.  */
 	fprintf (header_file, 
 		 "extern void gt_ggc_m_%s PARAMS ((void *));\n",
@@ -1487,7 +1554,7 @@ write_gc_roots (variables)
 	      fprintf (f, "    for (i = 0; i < (%s); i++)\n", length);
 	      fputs ("      {\n", f);
 	      write_gc_structure_fields (f, s, "x[i]", "x[i]",
-					 v->opt, 8, &v->line);
+					 v->opt, 8, &v->line, s->u.s.bitmap);
 	      fputs ("      }\n", f);
 	    }
 
@@ -1595,9 +1662,6 @@ main(argc, argv)
   set_gc_used_type (find_structure ("mem_attrs", 0), GC_POINTED_TO);
   set_gc_used_type (find_structure ("type_hash", 0), GC_POINTED_TO);
   set_gc_used_type (find_structure ("deferred_string", 0), GC_POINTED_TO);
-  set_gc_used_type (find_structure ("lang_type", 0), GC_POINTED_TO);
-  set_gc_used_type (find_structure ("lang_decl", 0), GC_POINTED_TO);
-  set_gc_used_type (find_structure ("lang_id2", 0), GC_POINTED_TO);
   set_gc_used_type (find_structure ("ehl_map_entry", 0), GC_POINTED_TO);
 
   open_base_files ();
Index: ggc-common.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ggc-common.c,v
retrieving revision 1.46.4.10
diff -p -u -p -r1.46.4.10 ggc-common.c
--- ggc-common.c	6 May 2002 18:44:24 -0000	1.46.4.10
+++ ggc-common.c	8 May 2002 09:10:04 -0000
@@ -35,15 +35,11 @@ Software Foundation, 59 Temple Place - S
 /* Statistics about the allocation.  */
 static ggc_statistics *ggc_stats;
 
-/* Trees that have been marked, but whose children still need marking.  */
-varray_type ggc_pending_trees;
-
 static void ggc_mark_rtx_children_1 PARAMS ((rtx));
 static void ggc_mark_rtx_varray_ptr PARAMS ((void *));
 static void ggc_mark_tree_varray_ptr PARAMS ((void *));
 static void ggc_mark_tree_hash_table_ptr PARAMS ((void *));
 static int ggc_htab_delete PARAMS ((void **, void *));
-static void ggc_mark_trees PARAMS ((void));
 static bool ggc_mark_tree_hash_table_entry PARAMS ((struct hash_entry *,
 						    hash_table_key));
 
@@ -195,8 +191,6 @@ ggc_mark_roots ()
   const struct ggc_root_tab *rti;
   size_t i;
   
-  VARRAY_TREE_INIT (ggc_pending_trees, 4096, "ggc_pending_trees");
-
   for (rt = gt_ggc_deletable_rtab; *rt; rt++)
     for (rti = *rt; rti->base != NULL; rti++)
       memset (rti->base, 0, rti->stride);
@@ -217,19 +211,10 @@ ggc_mark_roots ()
 	(*cb)(elt);
     }
 
-  /* Mark all the queued up trees, and their children.  */
-  ggc_mark_trees ();
-  VARRAY_FREE (ggc_pending_trees);
-
   /* Now scan all hash tables that have objects which are to be deleted if
-     they are not already marked.  Since these may mark more trees, we need
-     to reinitialize that varray.  */
-  VARRAY_TREE_INIT (ggc_pending_trees, 1024, "ggc_pending_trees");
-
+     they are not already marked.  */
   for (y = d_htab_roots; y != NULL; y = y->next)
     htab_traverse (y->htab, ggc_htab_delete, (PTR) y);
-  ggc_mark_trees ();
-  VARRAY_FREE (ggc_pending_trees);
 }
 
 /* R had not been previously marked, but has now been marked via
@@ -364,151 +349,6 @@ ggc_mark_rtx_children_1 (r)
   while ((r = next_rtx) != NULL);
 }
 
-/* Recursively set marks on all of the children of the
-   GCC_PENDING_TREES.  */
-
-static void
-ggc_mark_trees ()
-{
-  while (ggc_pending_trees->elements_used)
-    {
-      tree t;
-      enum tree_code code;
-
-      t = VARRAY_TOP_TREE (ggc_pending_trees);
-      VARRAY_POP (ggc_pending_trees);
-      code = TREE_CODE (t);
-
-      /* Collect statistics, if appropriate.  */
-      if (ggc_stats)
-	{
-	  ++ggc_stats->num_trees[(int) code];
-	  ggc_stats->size_trees[(int) code] += ggc_get_size (t);
-	}
-
-      /* Bits from common.  */
-      ggc_mark_tree (TREE_TYPE (t));
-      ggc_mark_tree (TREE_CHAIN (t));
-
-      /* Some nodes require special handling.  */
-      switch (code)
-	{
-	case TREE_LIST:
-	  ggc_mark_tree (TREE_PURPOSE (t));
-	  ggc_mark_tree (TREE_VALUE (t));
-	  continue;
-
-	case TREE_VEC:
-	  {
-	    int i = TREE_VEC_LENGTH (t);
-
-	    while (--i >= 0)
-	      ggc_mark_tree (TREE_VEC_ELT (t, i));
-	    continue;
-	  }
-
-	case COMPLEX_CST:
-	  ggc_mark_tree (TREE_REALPART (t));
-	  ggc_mark_tree (TREE_IMAGPART (t));
-	  break;
-
-	case PARM_DECL:
-	  ggc_mark_rtx (DECL_INCOMING_RTL (t));
-	  break;
-
-	case FIELD_DECL:
-	  ggc_mark_tree (DECL_FIELD_BIT_OFFSET (t));
-	  break;
-
-	case IDENTIFIER_NODE:
-	  (*lang_hooks.mark_tree) (t);
-	  continue;
-
-	default:
-	  break;
-	}
-  
-      /* But in general we can handle them by class.  */
-      switch (TREE_CODE_CLASS (code))
-	{
-	case 'd': /* A decl node.  */
-	  ggc_mark_tree (DECL_SIZE (t));
-	  ggc_mark_tree (DECL_SIZE_UNIT (t));
-	  ggc_mark_tree (DECL_NAME (t));
-	  ggc_mark_tree (DECL_CONTEXT (t));
-	  ggc_mark_tree (DECL_ARGUMENTS (t));
-	  ggc_mark_tree (DECL_RESULT_FLD (t));
-	  ggc_mark_tree (DECL_INITIAL (t));
-	  ggc_mark_tree (DECL_ABSTRACT_ORIGIN (t));
-	  ggc_mark_tree (DECL_SECTION_NAME (t));
-	  ggc_mark_tree (DECL_ATTRIBUTES (t));
-	  if (DECL_RTL_SET_P (t))
-	    ggc_mark_rtx (DECL_RTL (t));
-	  ggc_mark_rtx (DECL_LIVE_RANGE_RTL (t));
-	  ggc_mark_tree (DECL_VINDEX (t));
-	  if (DECL_ASSEMBLER_NAME_SET_P (t))
-	    ggc_mark_tree (DECL_ASSEMBLER_NAME (t));
-	  if (TREE_CODE (t) == FUNCTION_DECL)
-	    {
-	      ggc_mark_tree (DECL_SAVED_TREE (t));
-	      ggc_mark_tree (DECL_INLINED_FNS (t));
-	      if (DECL_SAVED_INSNS (t))
-		gt_ggc_m_function (DECL_SAVED_INSNS (t));
-	    }
-	  (*lang_hooks.mark_tree) (t);
-	  break;
-
-	case 't': /* A type node.  */
-	  ggc_mark_tree (TYPE_SIZE (t));
-	  ggc_mark_tree (TYPE_SIZE_UNIT (t));
-	  ggc_mark_tree (TYPE_ATTRIBUTES (t));
-	  ggc_mark_tree (TYPE_VALUES (t));
-	  ggc_mark_tree (TYPE_POINTER_TO (t));
-	  ggc_mark_tree (TYPE_REFERENCE_TO (t));
-	  ggc_mark_tree (TYPE_NAME (t));
-	  ggc_mark_tree (TYPE_MIN_VALUE (t));
-	  ggc_mark_tree (TYPE_MAX_VALUE (t));
-	  ggc_mark_tree (TYPE_NEXT_VARIANT (t));
-	  ggc_mark_tree (TYPE_MAIN_VARIANT (t));
-	  ggc_mark_tree (TYPE_BINFO (t));
-	  ggc_mark_tree (TYPE_CONTEXT (t));
-	  (*lang_hooks.mark_tree) (t);
-	  break;
-
-	case 'b': /* A lexical block.  */
-	  ggc_mark_tree (BLOCK_VARS (t));
-	  ggc_mark_tree (BLOCK_SUBBLOCKS (t));
-	  ggc_mark_tree (BLOCK_SUPERCONTEXT (t));
-	  ggc_mark_tree (BLOCK_ABSTRACT_ORIGIN (t));
-	  break;
-
-	case 'c': /* A constant.  */
-	  ggc_mark_rtx (TREE_CST_RTL (t));
-	  break;
-
-	case 'r': case '<': case '1':
-	case '2': case 'e': case 's': /* Expressions.  */
-	  {
-	    int i = TREE_CODE_LENGTH (TREE_CODE (t));
-	    int first_rtl = first_rtl_op (TREE_CODE (t));
-
-	    while (--i >= 0)
-	      {
-		if (i >= first_rtl)
-		  ggc_mark_rtx ((rtx) TREE_OPERAND (t, i));
-		else
-		  ggc_mark_tree (TREE_OPERAND (t, i));
-	      }
-	    break;	
-	  }
-
-	case 'x':
-	  (*lang_hooks.mark_tree) (t);
-	  break;
-	}
-    }
-}
-
 /* Mark all the elements of the varray V, which contains rtxs.  */
 
 void
@@ -592,13 +432,6 @@ gt_ggc_m_rtx_def (x)
      void *x;
 {
   ggc_mark_rtx((rtx)x);
-}
-
-void
-gt_ggc_m_tree_node (x)
-     void *x;
-{
-  ggc_mark_tree((tree)x);
 }
 
 /* Allocate a block of memory, then clear it.  */
Index: ggc.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ggc.h,v
retrieving revision 1.39.6.11
diff -p -u -p -r1.39.6.11 ggc.h
--- ggc.h	6 May 2002 18:44:25 -0000	1.39.6.11
+++ ggc.h	8 May 2002 09:10:04 -0000
@@ -37,9 +37,6 @@ extern const char empty_string[];	/* emp
 extern const char digit_vector[];	/* "0" .. "9" */
 #define digit_string(d) (digit_vector + ((d) * 2))
 
-/* Trees that have been marked, but whose children still need marking.  */
-extern varray_type ggc_pending_trees;
-
 /* Manipulate global roots that are needed between calls to gc.  */
 extern void ggc_add_root		PARAMS ((void *base, int nelt,
 						 int size, void (*)(void *)));
@@ -95,12 +92,7 @@ extern void ggc_mark_rtx_children	PARAMS
       ggc_mark_rtx_children (r__);              \
   } while (0)
 
-#define ggc_mark_tree(EXPR)				\
-  do {							\
-    tree const t__ = (EXPR);				\
-    if (ggc_test_and_set_mark (t__))			\
-      VARRAY_PUSH_TREE (ggc_pending_trees, t__);	\
-  } while (0)
+#define ggc_mark_tree gt_ggc_m_tree_node
 
 #define ggc_mark(EXPR)				\
   do {						\
Index: hashtable.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/hashtable.h,v
retrieving revision 1.2
diff -p -u -p -r1.2 hashtable.h
--- hashtable.h	11 Aug 2001 12:37:19 -0000	1.2
+++ hashtable.h	8 May 2002 09:10:04 -0000
@@ -23,7 +23,7 @@ Foundation, 59 Temple Place - Suite 330,
 /* This is what each hash table entry points to.  It may be embedded
    deeply within another object.  */
 typedef struct ht_identifier ht_identifier;
-struct ht_identifier
+struct ht_identifier GTY(())
 {
   unsigned int len;
   const unsigned char *str;
Index: langhooks-def.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/langhooks-def.h,v
retrieving revision 1.8.6.2
diff -p -u -p -r1.8.6.2 langhooks-def.h
--- langhooks-def.h	6 May 2002 18:44:29 -0000	1.8.6.2
+++ langhooks-def.h	8 May 2002 09:10:04 -0000
@@ -98,7 +98,6 @@ tree lhd_tree_inlining_convert_parm_for_
 #define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL lhd_do_nothing_t
 #define LANG_HOOKS_UNSAVE_EXPR_NOW	lhd_unsave_expr_now
 #define LANG_HOOKS_MAYBE_BUILD_CLEANUP	lhd_return_null_tree
-#define LANG_HOOKS_MARK_TREE		lhd_do_nothing_t
 #define LANG_HOOKS_SET_DECL_ASSEMBLER_NAME lhd_set_decl_assembler_name
 #define LANG_HOOKS_HONOR_READONLY	false
 #define LANG_HOOKS_PRINT_STATISTICS	lhd_do_nothing
@@ -237,7 +236,6 @@ int lhd_tree_dump_type_quals			PARAMS ((
   LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, \
   LANG_HOOKS_UNSAVE_EXPR_NOW, \
   LANG_HOOKS_MAYBE_BUILD_CLEANUP, \
-  LANG_HOOKS_MARK_TREE, \
   LANG_HOOKS_SET_DECL_ASSEMBLER_NAME, \
   LANG_HOOKS_HONOR_READONLY, \
   LANG_HOOKS_PRINT_STATISTICS, \
Index: langhooks.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/langhooks.h,v
retrieving revision 1.15.6.2
diff -p -u -p -r1.15.6.2 langhooks.h
--- langhooks.h	6 May 2002 18:44:31 -0000	1.15.6.2
+++ langhooks.h	8 May 2002 09:10:04 -0000
@@ -286,9 +286,6 @@ struct lang_hooks
      for the passed TARGET_EXPR.  Return NULL if there is none.  */
   tree (*maybe_build_cleanup) PARAMS ((tree));
 
-  /* Mark nodes held through the lang_specific hooks in the tree.  */
-  void (*mark_tree) PARAMS ((tree));
-
   /* Set the DECL_ASSEMBLER_NAME for a node.  If it is the sort of
      thing that the assembler should talk about, set
      DECL_ASSEMBLER_NAME to an appropriate IDENTIFIER_NODE.
Index: sdbout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/sdbout.c,v
retrieving revision 1.64.2.4
diff -p -u -p -r1.64.2.4 sdbout.c
--- sdbout.c	6 May 2002 18:45:00 -0000	1.64.2.4
+++ sdbout.c	8 May 2002 09:10:04 -0000
@@ -43,6 +43,7 @@ AT&T C compiler.  From the example below
 
 #include "config.h"
 #include "system.h"
+#include "debug.h"
 #include "tree.h"
 #include "ggc.h"
 
@@ -59,7 +60,6 @@ static GTY(()) tree anonymous_types;
 #include "toplev.h"
 #include "tm_p.h"
 #include "gsyms.h"
-#include "debug.h"
 #include "langhooks.h"
 
 /* 1 if PARM is passed to this function in memory.  */
@@ -1761,6 +1761,11 @@ sdbout_init (input_file_name)
       sdbout_symbol (t, 0);
 #endif  
 }
+
+#else  /* SDB_DEBUGGING_INFO */
+
+/* This should never be used, but its address is needed for comparisons.  */
+const struct gcc_debug_hooks sdb_debug_hooks;
 
 #endif /* SDB_DEBUGGING_INFO */
 
Index: system.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/system.h,v
retrieving revision 1.113.2.6
diff -p -u -p -r1.113.2.6 system.h
--- system.h	6 May 2002 18:45:05 -0000	1.113.2.6
+++ system.h	8 May 2002 09:10:04 -0000
@@ -617,7 +617,8 @@ typedef char _Bool;
 	TRADITIONAL_RETURN_FLOAT free_machine_status
 
 /* Hooks that are no longer used.  */
- #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE
+ #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE	\
+	LANG_HOOKS_MARK_TREE
 
 #endif /* IN_GCC */
 
Index: tree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.c,v
retrieving revision 1.230.2.6
diff -p -u -p -r1.230.2.6 tree.c
--- tree.c	6 May 2002 18:45:15 -0000	1.230.2.6
+++ tree.c	8 May 2002 09:10:05 -0000
@@ -1511,6 +1511,44 @@ first_rtl_op (code)
     }
 }
 
+/* Return which tree structure is used by T.  */
+
+enum tree_node_structure_enum
+tree_node_structure (t)
+     tree t;
+{
+  enum tree_code code = TREE_CODE (t);
+  
+  switch (TREE_CODE_CLASS (code))
+    {
+    case 'd':	return TS_DECL;
+    case 't':	return TS_TYPE;
+    case 'b':	return TS_BLOCK;
+    case 'r': case '<': case '1': case '2': case 'e': case 's': 
+      return TS_EXP;
+    default:  /* 'c' and 'x' */
+      break;
+    }
+  switch (code)
+    {
+      /* 'c' cases.  */
+    case INTEGER_CST:		return TS_INT_CST;
+    case REAL_CST:		return TS_REAL_CST;
+    case COMPLEX_CST:		return TS_COMPLEX;
+    case VECTOR_CST:		return TS_VECTOR;
+    case STRING_CST:		return TS_STRING;
+      /* 'x' cases.  */
+    case ERROR_MARK:		return TS_COMMON;
+    case IDENTIFIER_NODE:	return TS_IDENTIFIER;
+    case TREE_LIST:		return TS_LIST;
+    case TREE_VEC:		return TS_VEC;
+    case PLACEHOLDER_EXPR:	return TS_COMMON;
+
+    default:
+      abort ();
+    }
+}
+
 /* Perform any modifications to EXPR required when it is unsaved.  Does
    not recurse into EXPR's subtrees.  */
 
Index: tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.h,v
retrieving revision 1.299.2.8
diff -p -u -p -r1.299.2.8 tree.h
--- tree.h	6 May 2002 18:45:16 -0000	1.299.2.8
+++ tree.h	8 May 2002 09:10:05 -0000
@@ -118,7 +118,7 @@ extern tree built_in_decls[(int) END_BUI
    See the accessor macros, defined below, for documentation of the
    fields.  */
 
-struct tree_common
+struct tree_common GTY(())
 {
   tree chain;
   tree type;
@@ -702,7 +702,7 @@ extern void tree_class_check_failed PARA
         == (unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (B))	\
        && TREE_INT_CST_LOW (A) < TREE_INT_CST_LOW (B)))
  
-struct tree_int_cst
+struct tree_int_cst GTY(())
 {
   struct tree_common common;
   rtx rtl;	/* acts as link to register transfer language
@@ -710,7 +710,7 @@ struct tree_int_cst
   /* A sub-struct is necessary here because the function `const_hash'
      wants to scan both words as a unit and taking the address of the
      sub-struct yields the properly inclusive bounded pointer.  */
-  struct {
+  struct tree_int_cst_lowhi {
     unsigned HOST_WIDE_INT low;
     HOST_WIDE_INT high;
   } int_cst;
@@ -731,7 +731,7 @@ struct tree_int_cst
 
 #include "real.h"
 
-struct tree_real_cst
+struct tree_real_cst GTY(())
 {
   struct tree_common common;
   rtx rtl;	/* acts as link to register transfer language (rtl) info */
@@ -742,7 +742,7 @@ struct tree_real_cst
 #define TREE_STRING_LENGTH(NODE) (STRING_CST_CHECK (NODE)->string.length)
 #define TREE_STRING_POINTER(NODE) (STRING_CST_CHECK (NODE)->string.pointer)
 
-struct tree_string
+struct tree_string GTY(())
 {
   struct tree_common common;
   rtx rtl;	/* acts as link to register transfer language (rtl) info */
@@ -754,7 +754,7 @@ struct tree_string
 #define TREE_REALPART(NODE) (COMPLEX_CST_CHECK (NODE)->complex.real)
 #define TREE_IMAGPART(NODE) (COMPLEX_CST_CHECK (NODE)->complex.imag)
 
-struct tree_complex
+struct tree_complex GTY(())
 {
   struct tree_common common;
   rtx rtl;	/* acts as link to register transfer language (rtl) info */
@@ -765,7 +765,7 @@ struct tree_complex
 /* In a VECTOR_CST node.  */
 #define TREE_VECTOR_CST_ELTS(NODE) (VECTOR_CST_CHECK (NODE)->vector.elements)
 
-struct tree_vector
+struct tree_vector GTY(())
 {
   struct tree_common common;
   rtx rtl;
@@ -788,7 +788,7 @@ struct tree_vector
   ((tree) ((char *) (NODE) - sizeof (struct tree_common)))
 #define GCC_IDENT_TO_HT_IDENT(NODE) (&((struct tree_identifier *) (NODE))->id)
 
-struct tree_identifier
+struct tree_identifier GTY(())
 {
   struct tree_common common;
   struct ht_identifier id;
@@ -798,7 +798,7 @@ struct tree_identifier
 #define TREE_PURPOSE(NODE) (TREE_LIST_CHECK (NODE)->list.purpose)
 #define TREE_VALUE(NODE) (TREE_LIST_CHECK (NODE)->list.value)
 
-struct tree_list
+struct tree_list GTY(())
 {
   struct tree_common common;
   tree purpose;
@@ -811,11 +811,11 @@ struct tree_list
 #define TREE_VEC_END(NODE) \
   ((void) TREE_VEC_CHECK (NODE), &((NODE)->vec.a[(NODE)->vec.length]))
 
-struct tree_vec
+struct tree_vec GTY(())
 {
   struct tree_common common;
   int length;
-  tree a[1];
+  tree GTY ((length ("TREE_VEC_LENGTH ((tree)&%)"))) a[1];
 };
 
 /* Define fields and accessors for some nodes that represent expressions.  */
@@ -881,11 +881,12 @@ struct tree_vec
 #define TARGET_EXPR_INITIAL(NODE) TREE_OPERAND (TARGET_EXPR_CHECK (NODE), 1)
 #define TARGET_EXPR_CLEANUP(NODE) TREE_OPERAND (TARGET_EXPR_CHECK (NODE), 2)
 
-struct tree_exp
+struct tree_exp GTY(())
 {
   struct tree_common common;
   int complexity;
-  tree operands[1];
+  tree GTY ((special ("tree_exp"), 
+	     length ("TREE_CODE_LENGTH (TREE_CODE ((tree) &%))"))) operands[1];
 };
 
 /* In a BLOCK node.  */
@@ -933,7 +934,7 @@ struct tree_exp
 #define BLOCK_FRAGMENT_ORIGIN(NODE) (BLOCK_CHECK (NODE)->block.fragment_origin)
 #define BLOCK_FRAGMENT_CHAIN(NODE) (BLOCK_CHECK (NODE)->block.fragment_chain)
 
-struct tree_block
+struct tree_block GTY(())
 {
   struct tree_common common;
 
@@ -1213,7 +1214,7 @@ struct tree_block
 
 struct die_struct;
 
-struct tree_type
+struct tree_type GTY(())
 {
   struct tree_common common;
   tree values;
@@ -1247,9 +1248,10 @@ struct tree_type
   tree reference_to;
   union tree_type_symtab {
     int address; 
-    char *pointer;
-    struct die_struct *die;
-  } symtab;
+    char * GTY ((tag ("1"))) pointer; 
+    struct die_struct * GTY ((tag ("2"), skip (""))) die;
+  } GTY ((desc ("debug_hooks == &sdb_debug_hooks ? 1 : debug_hooks == &dwarf2_debug_hooks ? 2 : 0"), 
+	  descbits ("2"))) symtab;
   tree name;
   tree minval;
   tree maxval;
@@ -1761,7 +1763,7 @@ struct tree_type
 
 struct function;
 
-struct tree_decl
+struct tree_decl GTY(())
 {
   struct tree_common common;
   const char *filename;
@@ -1811,7 +1813,7 @@ struct tree_decl
   unsigned lang_flag_6 : 1;
   unsigned lang_flag_7 : 1;
 
-  union {
+  union tree_decl_u1 {
     /* In a FUNCTION_DECL for which DECL_BUILT_IN holds, this is
        DECL_FUNCTION_CODE.  */
     enum built_in_function f;
@@ -1820,8 +1822,11 @@ struct tree_decl
     HOST_WIDE_INT i;
     /* DECL_ALIGN and DECL_OFFSET_ALIGN.  (These are not used for
        FUNCTION_DECLs).  */
-    struct {unsigned int align : 24; unsigned int off_align : 8;} a;
-  } u1;
+    struct tree_decl_u1_a {
+      unsigned int align : 24; 
+      unsigned int off_align : 8;
+    } a;
+  } GTY ((skip (""))) u1;
 
   tree size_unit;
   tree name;
@@ -1841,12 +1846,12 @@ struct tree_decl
      In PARM_DECL, holds an RTL for the stack slot
      of register where the data was actually passed.
      Used by Chill and Java in LABEL_DECL and by C++ and Java in VAR_DECL.  */
-  union {
-    struct function *f;
-    rtx r;
-    tree t;
+  union tree_decl_u2 {
+    struct function * GTY ((tag ("FUNCTION_DECL"))) f;
+    rtx GTY ((tag ("PARM_DECL"))) r;
+    tree GTY ((tag ("FIELD_DECL"))) t;
     int i;
-  } u2;
+  } GTY ((desc ("TREE_CODE((tree) &(%0))"))) u2;
 
   /* In a FUNCTION_DECL, this is DECL_SAVED_TREE.  */
   tree saved_tree;
@@ -1861,25 +1866,43 @@ struct tree_decl
   struct lang_decl *lang_specific;
 };
 
+enum tree_node_structure_enum {
+  TS_COMMON,
+  TS_INT_CST,
+  TS_REAL_CST,
+  TS_VECTOR,
+  TS_STRING,
+  TS_COMPLEX,
+  TS_IDENTIFIER,
+  TS_DECL,
+  TS_TYPE,
+  TS_LIST,
+  TS_VEC,
+  TS_EXP,
+  TS_BLOCK,
+  LAST_TS_ENUM
+};
+
 /* Define the overall contents of a tree node.
    It may be any of the structures declared above
    for various types of node.  */
 
-union tree_node
+union tree_node GTY ((ptr_alias (union lang_tree_node),
+		      desc ("tree_node_structure (&%h)")))
 {
-  struct tree_common common;
-  struct tree_int_cst int_cst;
-  struct tree_real_cst real_cst;
-  struct tree_vector vector;
-  struct tree_string string;
-  struct tree_complex complex;
-  struct tree_identifier identifier;
-  struct tree_decl decl;
-  struct tree_type type;
-  struct tree_list list;
-  struct tree_vec vec;
-  struct tree_exp exp;
-  struct tree_block block;
+  struct tree_common GTY ((tag ("TS_COMMON"))) common;
+  struct tree_int_cst GTY ((tag ("TS_INT_CST"))) int_cst;
+  struct tree_real_cst GTY ((tag ("TS_REAL_CST"))) real_cst;
+  struct tree_vector GTY ((tag ("TS_VECTOR"))) vector;
+  struct tree_string GTY ((tag ("TS_STRING"))) string;
+  struct tree_complex GTY ((tag ("TS_COMPLEX"))) complex;
+  struct tree_identifier GTY ((tag ("TS_IDENTIFIER"))) identifier;
+  struct tree_decl GTY ((tag ("TS_DECL"))) decl;
+  struct tree_type GTY ((tag ("TS_TYPE"))) type;
+  struct tree_list GTY ((tag ("TS_LIST"))) list;
+  struct tree_vec GTY ((tag ("TS_VEC"))) vec;
+  struct tree_exp GTY ((tag ("TS_EXP"))) exp;
+  struct tree_block GTY ((tag ("TS_BLOCK"))) block;
  };
 
 /* Standard named or nameless data types of the C compiler.  */
@@ -2551,6 +2574,10 @@ extern tree save_expr			PARAMS ((tree));
    of operands if all are trees.  */
 
 extern int first_rtl_op			PARAMS ((enum tree_code));
+
+/* Return which tree structure is used by T.  */
+
+enum tree_node_structure_enum tree_node_structure PARAMS ((tree));
 
 /* unsave_expr (EXP) returns an expression equivalent to EXP but it
    can be used multiple times and will evaluate EXP in its entirety
Index: ada/ada-tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/ada-tree.h,v
retrieving revision 1.1.14.2
diff -p -u -p -r1.1.14.2 ada-tree.h
--- ada/ada-tree.h	6 May 2002 18:46:55 -0000	1.1.14.2
+++ ada/ada-tree.h	8 May 2002 09:10:06 -0000
@@ -34,6 +34,35 @@ enum gnat_tree_code {
 };
 #undef DEFTREECODE
 
+/* A tree to hold a loop ID.  */
+struct tree_loop_id GTY(()) 
+{
+  struct tree_common common;
+  struct nesting *loop_id;
+};
+
+/* The language-specific tree.  */
+union lang_tree_node 
+  GTY((desc ("TREE_CODE (&%h.generic) == GNAT_LOOP_ID")))
+{
+  union tree_node GTY ((tag ("0"), 
+			desc ("tree_node_structure (&%h)"))) 
+    generic;
+  struct tree_loop_id GTY ((tag ("1"))) loop_id;
+};
+
+/* Ada uses the lang_decl and lang_type fields to hold more trees.  */
+struct lang_decl GTY(()) 
+{
+  union lang_tree_node 
+    GTY((desc ("TREE_CODE (&%h.generic) == GNAT_LOOP_ID"))) t;
+};
+struct lang_type GTY(())
+{
+  union lang_tree_node 
+    GTY((desc ("TREE_CODE (&%h.generic) == GNAT_LOOP_ID"))) t;
+};
+
 /* Flags added to GCC type nodes.  */
 
 /* For RECORD_TYPE, UNION_TYPE, and QUAL_UNION_TYPE, nonzero if this is a
@@ -129,29 +158,29 @@ enum gnat_tree_code {
    by copy in copy out.  It is a CONSTRUCTOR.  For a full description of the
    cico parameter passing mechanism refer to the routine gnat_to_gnu_entity. */
 #define TYPE_CI_CO_LIST(NODE)   \
-  (tree) TYPE_LANG_SPECIFIC (FUNCTION_TYPE_CHECK (NODE))
+  (&TYPE_LANG_SPECIFIC (FUNCTION_TYPE_CHECK (NODE))->t.generic)
 
 /* For an INTEGER_TYPE with TYPE_MODULAR_P, this is the value of the
    modulus. */
 #define TYPE_MODULUS(NODE)  \
-  (tree) TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE))
+  (&TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE))->t.generic)
 
 /* For an INTEGER_TYPE that is the TYPE_DOMAIN of some ARRAY_TYPE, points to
    the type corresponding to the Ada index type.  */
 #define TYPE_INDEX_TYPE(NODE)	\
-  (tree) TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE))
+  (&TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE))->t.generic)
 
 /* For an INTEGER_TYPE with TYPE_VAX_FLOATING_POINT_P, stores the
    Digits_Value.  */
 #define TYPE_DIGITS_VALUE(NODE)  \
-  (long) TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE))
+  (long) TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE))->t.generic)
 
 /* 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.  */
 #define TYPE_RM_SIZE_ENUM(NODE)	\
-  (tree) TYPE_LANG_SPECIFIC (ENUMERAL_TYPE_CHECK (NODE))
+  (&TYPE_LANG_SPECIFIC (ENUMERAL_TYPE_CHECK (NODE))->t.generic)
 
 #define TYPE_RM_SIZE(NODE)					\
   (TREE_CODE (NODE) == ENUMERAL_TYPE ? TYPE_RM_SIZE_ENUM (NODE)	\
@@ -162,17 +191,17 @@ enum gnat_tree_code {
    unconstrained object.  Likewise for a RECORD_TYPE that is pointed
    to by a thin pointer.  */
 #define TYPE_UNCONSTRAINED_ARRAY(NODE)  \
-  (tree) TYPE_LANG_SPECIFIC (RECORD_TYPE_CHECK (NODE))
+  (&TYPE_LANG_SPECIFIC (RECORD_TYPE_CHECK (NODE))->t.generic)
 
 /* For other RECORD_TYPEs and all UNION_TYPEs and QUAL_UNION_TYPEs, the Ada
    size of the object.  This differs from the GCC size in that it does not
    include any rounding up to the alignment of the type.  */
-#define TYPE_ADA_SIZE(NODE)	(tree) TYPE_LANG_SPECIFIC (NODE)
+#define TYPE_ADA_SIZE(NODE)	(&TYPE_LANG_SPECIFIC (NODE)->t.generic)
 
 /* For an INTEGER_TYPE with TYPE_HAS_ACTUAL_BOUNDS_P or an ARRAY_TYPE, this is
    the index type that should be used when the actual bounds are required for
    a template.  This is used in the case of packed arrays.  */
-#define TYPE_ACTUAL_BOUNDS(NODE)   (tree) TYPE_LANG_SPECIFIC (NODE)
+#define TYPE_ACTUAL_BOUNDS(NODE)   (&TYPE_LANG_SPECIFIC (NODE)->t.generic)
 
 /* In an UNCONSTRAINED_ARRAY_TYPE, points to the record containing both
    the template and object.  */
@@ -211,12 +240,12 @@ enum gnat_tree_code {
    memory.  Used when a scalar constant is aliased or has its
    address taken.  */
 #define DECL_CONST_CORRESPONDING_VAR(NODE) \
-  (tree) DECL_LANG_SPECIFIC (CONST_DECL_CHECK (NODE))
+  (&DECL_LANG_SPECIFIC (CONST_DECL_CHECK (NODE))->t.generic)
 
 /* In a FIELD_DECL, points to the FIELD_DECL that was the ultimate
    source of the decl.  */
 #define DECL_ORIGINAL_FIELD(NODE) \
-  (tree) DECL_LANG_SPECIFIC (FIELD_DECL_CHECK (NODE))
+  (&DECL_LANG_SPECIFIC (FIELD_DECL_CHECK (NODE))->t.generic)
 
 /* In a FIELD_DECL corresponding to a discriminant, contains the
    discriminant number.  */
@@ -224,4 +253,5 @@ enum gnat_tree_code {
 
 /* This is a horrible kludge to store the loop_id of a loop into a tree
    node.  We need to find some other place to store it!  */
-#define TREE_LOOP_ID(NODE) (TREE_CHECK (NODE, GNAT_LOOP_ID)->real_cst.rtl)
+#define TREE_LOOP_ID(NODE) \
+  (((union tree_lang_node *)TREE_CHECK (NODE, GNAT_LOOP_ID))->loop_id.loop_id)
Index: ada/misc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/misc.c,v
retrieving revision 1.17.8.2
diff -p -u -p -r1.17.8.2 misc.c
--- ada/misc.c	6 May 2002 18:48:05 -0000	1.17.8.2
+++ ada/misc.c	8 May 2002 09:10:06 -0000
@@ -86,7 +86,6 @@ static const char *gnat_printable_name	P
 static tree gnat_eh_runtime_type	PARAMS ((tree));
 static int gnat_eh_type_covers		PARAMS ((tree, tree));
 static void gnat_parse_file		PARAMS ((int));
-static void gnat_mark_tree		PARAMS ((tree));
 static rtx gnat_expand_expr		PARAMS ((tree, rtx, enum machine_mode,
 						 int));
 
@@ -104,8 +103,6 @@ static rtx gnat_expand_expr		PARAMS ((tr
 #define LANG_HOOKS_DECODE_OPTION	gnat_decode_option
 #undef LANG_HOOKS_PARSE_FILE
 #define LANG_HOOKS_PARSE_FILE		gnat_parse_file
-#undef LANG_HOOKS_MARK_TREE
-#define LANG_HOOKS_MARK_TREE		gnat_mark_tree
 #undef LANG_HOOKS_HONOR_READONLY
 #define LANG_HOOKS_HONOR_READONLY	1
 #undef LANG_HOOKS_FINISH_INCOMPLETE_DECL
@@ -287,53 +284,6 @@ gnat_init_options ()
   gnat_argv = (char **) xmalloc ((save_argc + 1) * sizeof (gnat_argv[0])); 
   gnat_argv[0] = save_argv[0];     /* name of the command */ 
   gnat_argc = 1;
-}
-
-static void
-gnat_mark_tree (t)
-     tree t;
-{
-  switch (TREE_CODE (t))
-    {
-    case FUNCTION_TYPE:
-      ggc_mark_tree (TYPE_CI_CO_LIST (t));
-      return;
-
-    case INTEGER_TYPE:
-      if (TYPE_MODULAR_P (t))
-	ggc_mark_tree (TYPE_MODULUS (t));
-      else if (TYPE_VAX_FLOATING_POINT_P (t))
-	;
-      else if (TYPE_HAS_ACTUAL_BOUNDS_P (t))
-	ggc_mark_tree (TYPE_ACTUAL_BOUNDS (t));
-      else
-	ggc_mark_tree (TYPE_INDEX_TYPE (t));
-      return;
-
-    case ENUMERAL_TYPE:
-      ggc_mark_tree (TYPE_RM_SIZE_ENUM (t));
-      return;
-
-    case ARRAY_TYPE:
-      ggc_mark_tree (TYPE_ACTUAL_BOUNDS (t));
-      return;
-
-    case RECORD_TYPE:  case UNION_TYPE:  case QUAL_UNION_TYPE:
-      /* This is really TYPE_UNCONSTRAINED_ARRAY for fat pointers.  */
-      ggc_mark_tree (TYPE_ADA_SIZE (t));
-      return;
-
-    case CONST_DECL:
-      ggc_mark_tree (DECL_CONST_CORRESPONDING_VAR (t));
-      return;
-
-    case FIELD_DECL:
-      ggc_mark_tree (DECL_ORIGINAL_FIELD (t));
-      return;
-
-    default:
-      return;
-    }
 }
 
 /* Here is the function to handle the compiler error processing in GCC.  */
Index: ada/trans.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/trans.c,v
retrieving revision 1.10.8.4
diff -p -u -p -r1.10.8.4 trans.c
--- ada/trans.c	6 May 2002 18:49:34 -0000	1.10.8.4
+++ ada/trans.c	8 May 2002 09:10:06 -0000
@@ -2315,7 +2315,7 @@ tree_transform (gnat_node)
 	  {
 	    tree gnu_loop_id = make_node (GNAT_LOOP_ID);
 
-	    TREE_LOOP_ID (gnu_loop_id) = (rtx) loop_id;
+	    TREE_LOOP_ID (gnu_loop_id) = loop_id;
 	    save_gnu_tree (Entity (Identifier (gnat_node)), gnu_loop_id, 1);
 	  }
 
@@ -2404,8 +2404,7 @@ tree_transform (gnat_node)
 
 	if (Present (Name (gnat_node)))
 	  loop_id
-	    = (struct nesting *)
-	      TREE_LOOP_ID (get_gnu_tree (Entity (Name (gnat_node))));
+	    = TREE_LOOP_ID (get_gnu_tree (Entity (Name (gnat_node))));
 
 	if (Present (Condition (gnat_node)))
 	  gnu_cond = invert_truthvalue (gnat_truthvalue_conversion
Index: cp/Make-lang.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/Make-lang.in,v
retrieving revision 1.103.6.6
diff -p -u -p -r1.103.6.6 Make-lang.in
--- cp/Make-lang.in	6 May 2002 18:51:55 -0000	1.103.6.6
+++ cp/Make-lang.in	8 May 2002 09:10:09 -0000
@@ -260,7 +260,7 @@ cp/cp-lang.o: cp/cp-lang.c $(CXX_TREE_H)
 cp/decl.o: cp/decl.c $(CXX_TREE_H) flags.h cp/lex.h cp/decl.h stack.h \
   output.h $(EXPR_H) except.h toplev.h hash.h $(GGC_H) $(RTL_H) \
   cp/operators.def $(TM_P_H) tree-inline.h diagnostic.h c-pragma.h \
-  gt-cp-decl.h gtype-cp.h
+  debug.h gt-cp-decl.h gtype-cp.h
 cp/decl2.o: cp/decl2.c $(CXX_TREE_H) flags.h cp/lex.h cp/decl.h $(EXPR_H) \
   output.h except.h toplev.h $(GGC_H) $(RTL_H) gt-cp-decl2.h
 cp/typeck2.o: cp/typeck2.c $(CXX_TREE_H) flags.h toplev.h output.h $(TM_P_H) \
Index: cp/call.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/call.c,v
retrieving revision 1.304.2.4
diff -p -u -p -r1.304.2.4 call.c
--- cp/call.c	6 May 2002 18:51:56 -0000	1.304.2.4
+++ cp/call.c	8 May 2002 09:10:09 -0000
@@ -534,7 +534,7 @@ build_method_call (instance, name, parms
 
 /* New overloading code.  */
 
-struct z_candidate {
+struct z_candidate GTY(()) {
   tree fn;
   tree convs;
   tree second_conv;
@@ -571,8 +571,7 @@ struct z_candidate {
    should be created to hold the result of the conversion.  */
 #define NEED_TEMPORARY_P(NODE) TREE_LANG_FLAG_4 (NODE)
 
-#define USER_CONV_CAND(NODE) \
-  ((struct z_candidate *)WRAPPER_PTR (TREE_OPERAND (NODE, 1)))
+#define USER_CONV_CAND(NODE) WRAPPER_ZC (TREE_OPERAND (NODE, 1))
 #define USER_CONV_FN(NODE) (USER_CONV_CAND (NODE)->fn)
 
 int
@@ -1021,7 +1020,7 @@ convert_class_to_reference (t, s, expr)
   conv = build1 (IDENTITY_CONV, s, expr);
   conv = build_conv (USER_CONV, TREE_TYPE (TREE_TYPE (cand->fn)),
 		     conv);
-  TREE_OPERAND (conv, 1) = build_ptr_wrapper (cand);
+  TREE_OPERAND (conv, 1) = build_zc_wrapper (cand);
   ICS_USER_FLAG (conv) = 1;
   if (cand->viable == -1)
     ICS_BAD_FLAG (conv) = 1;
@@ -2548,7 +2547,7 @@ build_user_type_conversion_1 (totype, ex
     (USER_CONV,
      (DECL_CONSTRUCTOR_P (cand->fn)
       ? totype : non_reference (TREE_TYPE (TREE_TYPE (cand->fn)))),
-     expr, build_ptr_wrapper (cand));
+     expr, build_zc_wrapper (cand));
   
   ICS_USER_FLAG (cand->second_conv) = ICS_USER_FLAG (*p) = 1;
   if (cand->viable == -1)
@@ -3796,7 +3795,7 @@ convert_like_real (convs, expr, fn, argn
     case USER_CONV:
       {
 	struct z_candidate *cand
-	  = WRAPPER_PTR (TREE_OPERAND (convs, 1));
+	  = WRAPPER_ZC (TREE_OPERAND (convs, 1));
 	tree convfn = cand->fn;
 	tree args;
 
@@ -4130,7 +4129,7 @@ build_over_call (cand, args, flags)
   /* Give any warnings we noticed during overload resolution.  */
   if (cand->warnings)
     for (val = cand->warnings; val; val = TREE_CHAIN (val))
-      joust (cand, WRAPPER_PTR (TREE_VALUE (val)), 1);
+      joust (cand, WRAPPER_ZC (TREE_VALUE (val)), 1);
 
   if (DECL_FUNCTION_MEMBER_P (fn))
     enforce_access (cand->basetype_path, fn);
@@ -5176,7 +5175,7 @@ add_warning (winner, loser)
      struct z_candidate *winner, *loser;
 {
   winner->warnings = tree_cons (NULL_TREE,
-				build_ptr_wrapper (loser),
+				build_zc_wrapper (loser),
 				winner->warnings);
 }
 
Index: cp/cp-lang.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/cp-lang.c,v
retrieving revision 1.9.8.2
diff -p -u -p -r1.9.8.2 cp-lang.c
--- cp/cp-lang.c	6 May 2002 18:51:59 -0000	1.9.8.2
+++ cp/cp-lang.c	8 May 2002 09:10:09 -0000
@@ -66,8 +66,6 @@ static bool cxx_warn_unused_global_decl 
 #define LANG_HOOKS_TRUTHVALUE_CONVERSION c_common_truthvalue_conversion
 #undef LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES
 #define LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES cxx_insert_default_attributes
-#undef LANG_HOOKS_MARK_TREE
-#define LANG_HOOKS_MARK_TREE cxx_mark_tree
 #undef LANG_HOOKS_UNSAFE_FOR_REEVAL
 #define LANG_HOOKS_UNSAFE_FOR_REEVAL c_common_unsafe_for_reeval
 #undef LANG_HOOKS_SET_DECL_ASSEMBLER_NAME
Index: cp/cp-tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/cp-tree.h,v
retrieving revision 1.671.2.7
diff -p -u -p -r1.671.2.7 cp-tree.h
--- cp/cp-tree.h	6 May 2002 18:51:59 -0000	1.671.2.7
+++ cp/cp-tree.h	8 May 2002 09:10:10 -0000
@@ -233,9 +233,9 @@ extern int flag_huge_objects;
 
 /* Language-dependent contents of an identifier.  */
 
-struct lang_identifier
+struct lang_identifier GTY(())
 {
-  struct c_common_identifier ignore;
+  struct c_common_identifier c_common;
   tree namespace_bindings;
   tree bindings;
   tree class_value;
@@ -269,7 +269,7 @@ typedef struct flagged_type_tree_s GTY((
   tree lookups;
 } flagged_type_tree;
 
-typedef struct
+typedef struct template_parm_index_s GTY(())
 {
   struct tree_common common;
   HOST_WIDE_INT index;
@@ -278,14 +278,15 @@ typedef struct
   tree decl;
 } template_parm_index;
 
-typedef struct ptrmem_cst
+struct ptrmem_cst GTY(())
 {
   struct tree_common common;
   /* This isn't used, but the middle-end expects all constants to have
      this field.  */
   rtx rtl;
   tree member;
-}* ptrmem_cst_t;
+};
+typedef struct ptrmem_cst * ptrmem_cst_t;
 
 /* Nonzero if this binding is for a local scope, as opposed to a class
    or namespace scope.  */
@@ -347,13 +348,13 @@ typedef struct ptrmem_cst
     && MAIN_NAME_P (DECL_NAME (NODE)))
 
 
-struct tree_binding
+struct tree_binding GTY(())
 {
   struct tree_common common;
-  union {
-    tree scope;
-    struct cp_binding_level *level;
-  } scope;
+  union tree_binding_u {
+    tree GTY ((tag ("0"))) scope;
+    struct cp_binding_level * GTY ((tag ("1"))) level;
+  } GTY ((desc ("BINDING_HAS_LEVEL_P ((tree)&%0)"))) scope;
   tree value;
 };
 
@@ -371,7 +372,7 @@ struct tree_binding
    is not important for this node. */
 #define OVL_USED(NODE)        TREE_USED (NODE)
 
-struct tree_overload
+struct tree_overload GTY(())
 {
   struct tree_common common;
   tree function;
@@ -385,21 +386,17 @@ struct tree_overload
 #define SET_BASELINK_P(NODE) \
   (TREE_LANG_FLAG_1 (NODE) = 1)
 
-#define WRAPPER_PTR(NODE) (((struct tree_wrapper*)WRAPPER_CHECK (NODE))->u.ptr)
-#define WRAPPER_INT(NODE) (((struct tree_wrapper*)WRAPPER_CHECK (NODE))->u.i)
+#define WRAPPER_ZC(NODE) (((struct tree_wrapper*)WRAPPER_CHECK (NODE))->z_c)
 
-struct tree_wrapper
+struct tree_wrapper GTY(())
 {
   struct tree_common common;
-  union {
-    void *ptr;
-    int i;
-  } u;
+  struct z_candidate *z_c;
 };
 
 #define SRCLOC_FILE(NODE) (((struct tree_srcloc*)SRCLOC_CHECK (NODE))->filename)
 #define SRCLOC_LINE(NODE) (((struct tree_srcloc*)SRCLOC_CHECK (NODE))->linenum)
-struct tree_srcloc
+struct tree_srcloc GTY(())
 {
   struct tree_common common;
   const char *filename;
@@ -496,6 +493,35 @@ struct tree_srcloc
 /* Store a value in that field.  */
 #define C_SET_EXP_ORIGINAL_CODE(EXP, CODE) \
   (TREE_COMPLEXITY (EXP) = (int)(CODE))
+
+enum cp_tree_node_structure_enum {
+  TS_CP_COMMON,
+  TS_CP_GENERIC,
+  TS_CP_IDENTIFIER,
+  TS_CP_TPI,
+  TS_CP_PTRMEM,
+  TS_CP_BINDING,
+  TS_CP_OVERLOAD,
+  TS_CP_WRAPPER,
+  TS_CP_SRCLOC,
+  LAST_TS_CP_ENUM
+};
+
+/* The resulting tree type.  */
+union lang_tree_node GTY((desc ("cp_tree_node_structure (&%h)")))
+{
+  struct tree_common GTY ((tag ("TS_CP_COMMON"))) common;
+  union tree_node GTY ((tag ("TS_CP_GENERIC"),
+			desc ("tree_node_structure (&%h)"))) generic;
+  struct template_parm_index_s GTY ((tag ("TS_CP_TPI"))) tpi;
+  struct ptrmem_cst GTY ((tag ("TS_CP_PTRMEM"))) ptrmem;
+  struct tree_binding GTY ((tag ("TS_CP_BINDING"))) binding;
+  struct tree_overload GTY ((tag ("TS_CP_OVERLOAD"))) overload;
+  struct tree_wrapper GTY ((tag ("TS_CP_WRAPPER"))) wrapper;
+  struct tree_srcloc GTY ((tag ("TS_CP_SRCLOC"))) srcloc;
+  struct lang_identifier GTY ((tag ("TS_CP_IDENTIFIER"))) identifier;
+};
+
 
 enum cp_tree_index
 {
@@ -3720,7 +3746,8 @@ extern void insert_block			PARAMS ((tree
 extern void set_block				PARAMS ((tree));
 extern tree pushdecl				PARAMS ((tree));
 extern void cxx_init_decl_processing		PARAMS ((void));
-extern void cxx_mark_tree			PARAMS ((tree));
+enum cp_tree_node_structure_enum cp_tree_node_structure 
+  PARAMS ((union lang_tree_node *));
 extern void cxx_insert_default_attributes	PARAMS ((tree));
 extern bool cxx_mark_addressable		PARAMS ((tree));
 extern void cxx_push_function_context		PARAMS ((struct function *));
@@ -4338,8 +4365,7 @@ extern tree vec_binfo_member			PARAMS ((
 extern tree decl_namespace_context		PARAMS ((tree));
 extern tree lvalue_type				PARAMS ((tree));
 extern tree error_type				PARAMS ((tree));
-extern tree build_ptr_wrapper			PARAMS ((void *));
-extern tree build_int_wrapper			PARAMS ((int));
+extern tree build_zc_wrapper			PARAMS ((struct z_candidate *));
 extern tree build_srcloc_here			PARAMS ((void));
 extern int varargs_function_p			PARAMS ((tree));
 extern int really_overloaded_fn			PARAMS ((tree));
Index: cp/decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.847.2.10
diff -p -u -p -r1.847.2.10 decl.c
--- cp/decl.c	6 May 2002 18:52:01 -0000	1.847.2.10
+++ cp/decl.c	8 May 2002 09:10:12 -0000
@@ -48,6 +48,7 @@ Boston, MA 02111-1307, USA.  */
 #include "c-common.h"
 #include "c-pragma.h"
 #include "diagnostic.h"
+#include "debug.h"
 
 #ifndef BOOL_TYPE_SIZE
 /* `bool' has size and alignment `1', on all platforms.  */
@@ -14535,36 +14536,25 @@ cxx_pop_function_context (f)
   f->language = 0;
 }
 
-void
-cxx_mark_tree (t)
-     tree t;
-{
-  enum tree_code code = TREE_CODE (t);
-  if (code == IDENTIFIER_NODE)
-    {
-      struct lang_identifier *li = (struct lang_identifier *) t;
-      ggc_mark_tree (li->namespace_bindings);
-      ggc_mark_tree (li->bindings);
-      ggc_mark_tree (li->class_value);
-      ggc_mark_tree (li->class_template_info);
-      gt_ggc_m_lang_id2 (li->x);
-    }
-  else if (code == CPLUS_BINDING)
-    {
-      if (BINDING_HAS_LEVEL_P (t))
-	gt_ggc_m_cp_binding_level (&BINDING_LEVEL (t));
-      else
-	ggc_mark_tree (BINDING_SCOPE (t));
-      ggc_mark_tree (BINDING_VALUE (t));
-    }
-  else if (code == OVERLOAD)
-    ggc_mark_tree (OVL_FUNCTION (t));
-  else if (code == TEMPLATE_PARM_INDEX)
-    ggc_mark_tree (TEMPLATE_PARM_DECL (t));
-   else if (TYPE_P (t))
-    gt_ggc_m_lang_type (TYPE_LANG_SPECIFIC (t));
-  else if (DECL_P (t))
-    gt_ggc_m_lang_decl (DECL_LANG_SPECIFIC (t));
+/* Return which tree structure is used by T, or TS_CP_GENERIC if T is
+   one of the language-independent trees.  */
+
+enum cp_tree_node_structure_enum
+cp_tree_node_structure (t)
+     union lang_tree_node *t;
+{
+  switch (TREE_CODE (&t->generic))
+    {
+    case DEFAULT_ARG:		return TS_CP_IDENTIFIER;
+    case IDENTIFIER_NODE:	return TS_CP_IDENTIFIER;
+    case CPLUS_BINDING:		return TS_CP_BINDING;
+    case OVERLOAD:		return TS_CP_OVERLOAD;
+    case TEMPLATE_PARM_INDEX:	return TS_CP_TPI;
+    case PTRMEM_CST:		return TS_CP_PTRMEM;
+    case WRAPPER:		return TS_CP_WRAPPER;
+    case SRCLOC:		return TS_CP_SRCLOC;
+    default:			return TS_CP_GENERIC;
+    }
 }
 
 /* Return the IDENTIFIER_GLOBAL_VALUE of T, for use in common code, since
Index: cp/tree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/tree.c,v
retrieving revision 1.264.6.4
diff -p -u -p -r1.264.6.4 tree.c
--- cp/tree.c	6 May 2002 18:52:18 -0000	1.264.6.4
+++ cp/tree.c	8 May 2002 09:10:12 -0000
@@ -1717,25 +1717,15 @@ cp_tree_equal (t1, t2)
   return -1;
 }
 
-/* Build a wrapper around some pointer PTR so we can use it as a tree.  */
+/* Build a wrapper around a 'struct z_candidate' so we can use it as a
+   tree.  */
 
 tree
-build_ptr_wrapper (ptr)
-     void *ptr;
+build_zc_wrapper (ptr)
+     struct z_candidate *ptr;
 {
   tree t = make_node (WRAPPER);
-  WRAPPER_PTR (t) = ptr;
-  return t;
-}
-
-/* Build a wrapper around some integer I so we can use it as a tree.  */
-
-tree
-build_int_wrapper (i)
-     int i;
-{
-  tree t = make_node (WRAPPER);
-  WRAPPER_INT (t) = i;
+  WRAPPER_ZC (t) = ptr;
   return t;
 }
 
Index: f/Make-lang.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/f/Make-lang.in,v
retrieving revision 1.104.6.4
diff -p -u -p -r1.104.6.4 Make-lang.in
--- f/Make-lang.in	6 May 2002 18:52:30 -0000	1.104.6.4
+++ f/Make-lang.in	8 May 2002 09:10:12 -0000
@@ -366,7 +366,7 @@ f/com.o: f/com.c f/proj.h $(CONFIG_H) $(
  f/bad.def f/where.h glimits.h f/top.h f/lex.h f/type.h f/intrin.h \
  f/intrin.def f/lab.h f/symbol.h f/symbol.def f/equiv.h f/storag.h f/global.h \
  f/name.h f/expr.h f/implic.h f/src.h f/st.h $(GGC_H) toplev.h diagnostic.h \
- langhooks.h langhooks-def.h intl.h gt-f-com.h gtype-f.h
+ langhooks.h langhooks-def.h intl.h debug.h gt-f-com.h gtype-f.h
 f/data.o: f/data.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/data.h f/bld.h f/bld-op.def \
  f/bit.h f/malloc.h f/com.h f/com-rt.def $(TREE_H) f/info.h f/info-b.def \
  f/info-k.def f/info-w.def f/target.h f/bad.h f/bad.def f/where.h glimits.h \
Index: f/com.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/f/com.c,v
retrieving revision 1.148.6.6
diff -p -u -p -r1.148.6.6 com.c
--- f/com.c	6 May 2002 18:52:31 -0000	1.148.6.6
+++ f/com.c	8 May 2002 09:10:16 -0000
@@ -92,6 +92,7 @@ the Free Software Foundation, 59 Temple 
 #include "intl.h"
 #include "langhooks.h"
 #include "langhooks-def.h"
+#include "debug.h"
 
 /* VMS-specific definitions */
 #ifdef VMS
@@ -573,12 +574,14 @@ static const struct f_binding_level clea
 
 /* Language-dependent contents of an identifier.  */
 
-struct lang_identifier
-  {
-    struct tree_identifier ignore;
-    tree global_value, local_value, label_value;
-    bool invented;
-  };
+struct lang_identifier GTY(())
+{
+  struct tree_identifier common;
+  tree global_value;
+  tree local_value;
+  tree label_value;
+  bool invented;
+};
 
 /* Macros for access to language-specific slots in an identifier.  */
 /* Each of these slots contains a DECL node or null.  */
@@ -599,6 +602,24 @@ struct lang_identifier
 #define IDENTIFIER_INVENTED(NODE)	\
   (((struct lang_identifier *)(NODE))->invented)
 
+/* The resulting tree type.  */
+union lang_tree_node 
+  GTY((desc ("TREE_CODE (&%h.generic) == IDENTIFIER_NODE")))
+{
+  union tree_node GTY ((tag ("0"), 
+			desc ("tree_node_structure (&%h)"))) 
+    generic;
+  struct lang_identifier GTY ((tag ("1"))) identifier;
+};
+
+/* Fortran doesn't use either of these.  */
+struct lang_decl GTY(()) 
+{
+};
+struct lang_type GTY(())
+{
+};
+
 /* In identifiers, C uses the following fields in a special way:
    TREE_PUBLIC	      to record that there was a previous local extern decl.
    TREE_USED	      to record that such a decl was used.
@@ -14100,7 +14121,6 @@ static const char *ffe_init PARAMS ((con
 static void ffe_finish PARAMS ((void));
 static void ffe_init_options PARAMS ((void));
 static void ffe_print_identifier PARAMS ((FILE *, tree, int));
-static void ffe_mark_tree (tree);
 
 struct language_function GTY(())
 {
@@ -14119,8 +14139,6 @@ struct language_function GTY(())
 #define LANG_HOOKS_DECODE_OPTION	ffe_decode_option
 #undef  LANG_HOOKS_PARSE_FILE
 #define LANG_HOOKS_PARSE_FILE		ffe_parse_file
-#undef  LANG_HOOKS_MARK_TREE
-#define LANG_HOOKS_MARK_TREE		ffe_mark_tree
 #undef  LANG_HOOKS_MARK_ADDRESSABLE
 #define LANG_HOOKS_MARK_ADDRESSABLE	ffe_mark_addressable
 #undef  LANG_HOOKS_PRINT_IDENTIFIER
@@ -15043,21 +15061,6 @@ ffe_unsigned_type (type)
     }
 
   return type;
-}
-
-static void
-ffe_mark_tree (t)
-     tree t;
-{
-  if (TREE_CODE (t) == IDENTIFIER_NODE)
-    {
-      struct lang_identifier *i = (struct lang_identifier *) t;
-      ggc_mark_tree (IDENTIFIER_GLOBAL_VALUE (i));
-      ggc_mark_tree (IDENTIFIER_LOCAL_VALUE (i));
-      ggc_mark_tree (IDENTIFIER_LABEL_VALUE (i));
-    }
-  else if (TYPE_P (t) && TYPE_LANG_SPECIFIC (t))
-    ggc_mark (TYPE_LANG_SPECIFIC (t));
 }
 
 /* From gcc/cccp.c, the code to handle -I.  */
Index: java/Make-lang.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/Make-lang.in,v
retrieving revision 1.78.6.5
diff -p -u -p -r1.78.6.5 Make-lang.in
--- java/Make-lang.in	6 May 2002 18:52:42 -0000	1.78.6.5
+++ java/Make-lang.in	8 May 2002 09:10:18 -0000
@@ -261,7 +261,7 @@ JAVA_LEX_C = java/lex.c java/keyword.h j
 
 java/parse.o: java/parse.c java/jcf-reader.c $(CONFIG_H) $(SYSTEM_H) \
   function.h $(JAVA_TREE_H) $(JAVA_LEX_C) java/parse.h java/lex.h $(GGC_H) \
-  gt-java-parse.h gtype-java.h
+  debug.h gt-java-parse.h gtype-java.h
 java/jcf-dump.o: $(CONFIG_H) $(SYSTEM_H) $(JAVA_TREE_H) java/jcf-dump.c \
   java/jcf-reader.c java/jcf.h java/javaop.h java/javaop.def version.h
 java/gjavah.o: $(CONFIG_H) $(SYSTEM_H) $(JAVA_TREE_H) java/gjavah.c \
Index: java/java-tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/java-tree.h,v
retrieving revision 1.133.6.5
diff -p -u -p -r1.133.6.5 java-tree.h
--- java/java-tree.h	6 May 2002 18:52:43 -0000	1.133.6.5
+++ java/java-tree.h	8 May 2002 09:10:18 -0000
@@ -678,16 +678,27 @@ extern struct CPool *outgoing_cpool; 
 
 extern const char *cyclic_inheritance_report;
 
-struct lang_identifier
+struct lang_identifier GTY(())
 {
   struct tree_identifier ignore;
-  tree global_value, local_value;
+  tree global_value;
+  tree local_value;
 
   /* If non-NULL:  An ADDR_REF to a VAR_DECL that contains
    * the Utf8Const representation of the identifier.  */
   tree utf8_ref;
 };
 
+/* The resulting tree type.  */
+union lang_tree_node 
+  GTY((desc ("TREE_CODE (&%h.generic) == IDENTIFIER_NODE")))
+{
+  union tree_node GTY ((tag ("0"), 
+			desc ("tree_node_structure (&%h)"))) 
+    generic;
+  struct lang_identifier GTY ((tag ("1"))) identifier;
+};
+
 /* Macros for access to language-specific slots in an identifier.  */
 /* Unless specified, each of these slots contains a DECL node or null.  */
 
@@ -924,7 +935,7 @@ struct lang_identifier
 #define DECL_BIT_INDEX(DECL) (DECL_CHECK (DECL)->decl.pointer_alias_set)
 
 /* DECL_LANG_SPECIFIC for FUNCTION_DECLs. */
-struct lang_decl_func
+struct lang_decl_func GTY(())
 {
   /*  tree chain; not yet used. */
   long code_offset;
@@ -964,7 +975,7 @@ struct init_test_hash_entry
 
 /* DECL_LANG_SPECIFIC for VAR_DECL, PARM_DECL and sometimes FIELD_DECL
    (access methods on outer class fields) and final fields. */
-struct lang_decl_var
+struct lang_decl_var GTY(())
 {
   int slot_number;
   int start_pc;
@@ -983,13 +994,13 @@ enum lang_decl_desc {
   LANG_DECL_VAR
 };
 
-struct lang_decl
+struct lang_decl GTY(())
 {
   enum lang_decl_desc desc;
   union lang_decl_u {
-    struct lang_decl_func f;
-    struct lang_decl_var v;
-  } 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'.  */
Index: java/lang.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/lang.c,v
retrieving revision 1.84.6.4
diff -p -u -p -r1.84.6.4 lang.c
--- java/lang.c	6 May 2002 18:52:45 -0000	1.84.6.4
+++ java/lang.c	8 May 2002 09:10:18 -0000
@@ -230,8 +230,6 @@ struct language_function GTY(())
 #define LANG_HOOKS_DECODE_OPTION java_decode_option
 #undef LANG_HOOKS_PARSE_FILE
 #define LANG_HOOKS_PARSE_FILE java_parse_file
-#undef LANG_HOOKS_MARK_TREE
-#define LANG_HOOKS_MARK_TREE java_mark_tree
 #undef LANG_HOOKS_MARK_ADDRESSABLE
 #define LANG_HOOKS_MARK_ADDRESSABLE java_mark_addressable
 #undef LANG_HOOKS_EXPAND_EXPR
Index: java/parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.343.6.4
diff -p -u -p -r1.343.6.4 parse.y
--- java/parse.y	6 May 2002 18:52:46 -0000	1.343.6.4
+++ java/parse.y	8 May 2002 09:10:22 -0000
@@ -65,6 +65,7 @@ definitions and other extensions.  */
 #include "function.h"
 #include "except.h"
 #include "ggc.h"
+#include "debug.h"
 
 #ifndef DIR_SEPARATOR
 #define DIR_SEPARATOR '/'
Index: objc/objc-lang.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/objc/objc-lang.c,v
retrieving revision 1.2.10.3
diff -p -u -p -r1.2.10.3 objc-lang.c
--- objc/objc-lang.c	6 May 2002 18:52:49 -0000	1.2.10.3
+++ objc/objc-lang.c	8 May 2002 09:10:22 -0000
@@ -46,8 +46,6 @@ static void objc_post_options           
 #define LANG_HOOKS_POST_OPTIONS objc_post_options
 #undef LANG_HOOKS_PARSE_FILE
 #define LANG_HOOKS_PARSE_FILE c_common_parse_file
-#undef LANG_HOOKS_MARK_TREE
-#define LANG_HOOKS_MARK_TREE c_mark_tree
 #undef LANG_HOOKS_EXPAND_EXPR
 #define LANG_HOOKS_EXPAND_EXPR c_expand_expr
 #undef LANG_HOOKS_MARK_ADDRESSABLE
============================================================


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