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]

[PATCH] Fix PR45947


My decl-context lto streaming change exposed that we are not properly
walking all varpool nodes (even though we are streaming them all)
which leads to some record types not being fixed-up during
free-lang-data.

Bootstrapped and tested on x86_64-unknown-linux-gnu, committed.

Richard.

2010-10-09  Richard Guenther  <rguenther@suse.de>

	PR lto/45947
	* tree.c (free_lang_data_in_cgraph): Properly walk the varpool.

	* g++.dg/lto/20101009-1_0.C: New testcase.

Index: gcc/tree.c
===================================================================
*** gcc/tree.c	(revision 165221)
--- gcc/tree.c	(working copy)
*************** free_lang_data_in_cgraph (void)
*** 4982,4988 ****
      find_decls_types (p->decl, &fld);
  
    /* Find decls and types in every varpool symbol.  */
!   for (v = varpool_nodes_queue; v; v = v->next_needed)
      find_decls_types_in_var (v, &fld);
  
    /* Set the assembler name on every decl found.  We need to do this
--- 4982,4988 ----
      find_decls_types (p->decl, &fld);
  
    /* Find decls and types in every varpool symbol.  */
!   for (v = varpool_nodes; v; v = v->next)
      find_decls_types_in_var (v, &fld);
  
    /* Set the assembler name on every decl found.  We need to do this
Index: gcc/testsuite/g++.dg/lto/20101009-1_0.C
===================================================================
*** gcc/testsuite/g++.dg/lto/20101009-1_0.C	(revision 0)
--- gcc/testsuite/g++.dg/lto/20101009-1_0.C	(revision 0)
***************
*** 0 ****
--- 1,14 ----
+ // { dg-lto-do link }
+ 
+ template < typename > struct X
+ {
+   template < typename > static int test ();
+   static const int i = sizeof (test < int >());
+ };
+ 
+ template struct X < int >;
+ 
+ int main()
+ {
+   return 0;
+ }


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