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 fallout of earlier LTO debuginfo patch


This fixes the type walker to deal with non-type TYPE_CONTEXT.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied as obvious.

Richard.

2010-04-26  Richard Guenther  <rguenther@suse.de>

	* lto.c (lto_fixup_type): Deal with non-type TYPE_CONTEXT.

	* gcc.dg/lto/20100426_0.c: New testcase.

Index: gcc/lto/lto.c
===================================================================
*** gcc/lto/lto.c	(revision 158721)
--- gcc/lto/lto.c	(working copy)
*************** lto_fixup_type (tree t, void *data)
*** 1422,1428 ****
    /* Accessor is for derived node types only. */
    LTO_FIXUP_SUBTREE (t->type.binfo);
  
!   LTO_REGISTER_TYPE_AND_FIXUP_SUBTREE (TYPE_CONTEXT (t));
    LTO_REGISTER_TYPE_AND_FIXUP_SUBTREE (TYPE_CANONICAL (t));
  
    /* The following re-creates proper variant lists while fixing up
--- 1422,1434 ----
    /* Accessor is for derived node types only. */
    LTO_FIXUP_SUBTREE (t->type.binfo);
  
!   if (TYPE_CONTEXT (t))
!     {
!       if (TYPE_P (TYPE_CONTEXT (t)))
! 	LTO_REGISTER_TYPE_AND_FIXUP_SUBTREE (TYPE_CONTEXT (t));
!       else
! 	LTO_FIXUP_SUBTREE (TYPE_CONTEXT (t));
!     }
    LTO_REGISTER_TYPE_AND_FIXUP_SUBTREE (TYPE_CANONICAL (t));
  
    /* The following re-creates proper variant lists while fixing up
Index: gcc/testsuite/gcc.dg/lto/20100426_0.c
===================================================================
*** gcc/testsuite/gcc.dg/lto/20100426_0.c	(revision 0)
--- gcc/testsuite/gcc.dg/lto/20100426_0.c	(revision 0)
***************
*** 0 ****
--- 1,7 ----
+ /* { dg-lto-do link } */
+ /* { dg-lto-options {{-r -nostdlib -flto -g}} } */
+ 
+ long Perl_my_htonl (long l)
+ {
+       union { } u;
+ }


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