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]

[lto] gc fixes


The patch below solves one of the major remaining problems: lto1 dies on
the first GC.  The fix is to tell GTY that LTO language nodes chain with
GENERIC_NEXT rather than TREE_CHAIN.

There are other minor makefile and GC-related fixes in this patch as
well.  I don't understand GTY all that well, but from reading the
documentation, it sounds like these bits are necessary.  The
dependencies for some files were also incomplete or redundant; I found
myself unable to build a clean checkout while trying to debug other
things.

Committed to the LTO branch.

-Nathan

gcc/
	* Makefile.in (lto/lto-stream-debug.o): Add dependency on $(TREE_H).

gcc/lto/
	* lto-tree.h (union lang_tree_node): Change GTY description to chain
	with GENERIC_NEXT.
	* config-lang.in (gtfiles): Add lto-lang.c.
	* lto-lang.c: Include gt-lto-lto-lang.h.
	* Make-lang.in (lto/lto-lang.o): Add dependency on gt-lto-lto-lang.h
	(lto/lto-symtab.o): Depend on LTO_H instead of TREE_H.
	(lto/lto-read.o): Likewise.

Index: gcc/Makefile.in
===================================================================
--- gcc/Makefile.in	(revision 129768)
+++ gcc/Makefile.in	(working copy)
@@ -1957,7 +1957,7 @@ double-int.o: double-int.c $(CONFIG_H) $
 
 lto-stream-debug.o : lto-stream-debug.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
    toplev.h $(FLAGS_H) $(PARAMS_H) input.h debug.h $(LTO_TAGS_H) \
-   lto-tree-flags.def lto-tree-tags.def 
+   lto-tree-flags.def lto-tree-tags.def $(TREE_H)
 lto-function-out.o : lto-function-out.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
    $(TM_H) toplev.h $(TREE_H) $(EXPR_H) $(FLAGS_H) $(PARAMS_H) input.h \
    $(VARRAY_H) $(HASHTAB_H) langhooks.h $(BASIC_BLOCK_H) tree-iterator.h \
Index: gcc/lto/Make-lang.in
===================================================================
--- gcc/lto/Make-lang.in	(revision 129768)
+++ gcc/lto/Make-lang.in	(working copy)
@@ -78,15 +78,15 @@ $(LTO_EXE): $(LTO_OBJS) $(BACKEND) $(LIB
 
 lto/lto-lang.o: lto/lto-lang.c $(CONFIG_H) coretypes.h debug.h \
 	flags.h $(GGC_H) langhooks.h $(LANGHOOKS_DEF_H) $(SYSTEM_H) \
-	$(TM_H) lto/lto-tree.h $(LTO_H) gtype-lto.h
+	$(TM_H) lto/lto-tree.h $(LTO_H) gtype-lto.h gt-lto-lto-lang.h
 lto/lto.o: lto/lto.c $(CONFIG_H) $(CGRAPH_H) coretypes.h dwarf2.h \
 	$(GGC_H) opts.h $(SYSTEM_H) toplev.h $(TM_H) $(LTO_H)
 lto/lto-elf.o: lto/lto-elf.c $(CONFIG_H) coretypes.h $(SYSTEM_H) \
 	toplev.h $(LTO_H) $(LTO_TAGS_H) $(TM_H)
 lto/lto-symtab.o: lto/lto-symtab.c $(CONFIG_H) coretypes.h \
-	$(SYSTEM_H) toplev.h $(TREE_H) $(LTO_H) lto/lto-tree.h
+	$(SYSTEM_H) toplev.h $(LTO_H) lto/lto-tree.h
 lto/lto-read.o: lto/lto-read.c $(CONFIG_H) $(SYSTEM_H) \
-	coretypes.h $(TM_H) toplev.h $(TREE_H) $(EXPR_H) $(FLAGS_H) \
+	coretypes.h $(TM_H) toplev.h $(LTO_H) $(EXPR_H) $(FLAGS_H) \
 	$(PARAMS_H) input.h $(VARRAY_H) $(HASHTAB_H) langhooks.h \
 	$(BASIC_BLOCK_H) tree-iterator.h tree-pass.h tree-flow.h \
 	$(CGRAPH_H) $(FUNCTION_H) $(GGC_H) $(DIAGNOSTIC_H) \
Index: gcc/lto/lto-tree.h
===================================================================
--- gcc/lto/lto-tree.h	(revision 129768)
+++ gcc/lto/lto-tree.h	(working copy)
@@ -50,7 +50,7 @@ enum lto_tree_node_structure_enum {
 
 union lang_tree_node GTY(
  (desc ("lto_tree_node_structure (&%h)"),
-  chain_next ("(union lang_tree_node *)TREE_CHAIN (&%h.generic)")))
+  chain_next ("(union lang_tree_node *)GENERIC_NEXT (&%h.generic)")))
 {
   union tree_node GTY ((tag ("TS_LTO_GENERIC"),
 			desc ("tree_node_structure (&%h)"))) generic;
Index: gcc/lto/config-lang.in
===================================================================
--- gcc/lto/config-lang.in	(revision 129768)
+++ gcc/lto/config-lang.in	(working copy)
@@ -23,4 +23,4 @@ language="lto"
 compilers="lto1\$(exeext)"
 stagestuff="lto1\$(exeext)"
 
-gtfiles="\$(srcdir)/lto/lto-tree.h"
+gtfiles="\$(srcdir)/lto/lto-tree.h \$(srcdir)/lto/lto-lang.c"
Index: gcc/lto/lto-lang.c
===================================================================
--- gcc/lto/lto-lang.c	(revision 129768)
+++ gcc/lto/lto-lang.c	(working copy)
@@ -233,3 +233,4 @@ lto_tree_node_structure (union lang_tree
 
 #include "ggc.h"
 #include "gtype-lto.h"
+#include "gt-lto-lto-lang.h"


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