diff options
author | Richard Guenther <rguenther@suse.de> | 2010-10-18 10:54:18 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-10-18 10:54:18 +0000 |
commit | e20efbfb7312eab0c80dd4a9f0367119620aa661 (patch) | |
tree | a808bd4d531975f3bce15d194011b1c4df7d101a | |
parent | ee1feb1499a5d8bc83e16906f2359c16443cbda7 (diff) | |
download | gcc-e20efbfb7312eab0c80dd4a9f0367119620aa661.zip gcc-e20efbfb7312eab0c80dd4a9f0367119620aa661.tar.gz gcc-e20efbfb7312eab0c80dd4a9f0367119620aa661.tar.bz2 |
re PR lto/44950 (ICE in dwarf2out_finish, at dwarf2out.c:22271)
2010-10-18 Richard Guenther <rguenther@suse.de>
PR lto/44950
* tree.c (free_lang_data_in_decl): As we clear TYPE_METHODS
also clear references to entries of it.
* g++.dg/lto/20101015-2_0.C: New testcase.
From-SVN: r165629
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/lto/20101015-2_0.C | 6 | ||||
-rw-r--r-- | gcc/tree.c | 9 |
4 files changed, 26 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 74d2eef..244d20b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-10-18 Richard Guenther <rguenther@suse.de> + + PR lto/44950 + * tree.c (free_lang_data_in_decl): As we clear TYPE_METHODS + also clear references to entries of it. + 2010-10-18 Andi Kleen <ak@linux.intel.com> PR other/43448 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f7f964b..fd169c8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-10-18 Richard Guenther <rguenther@suse.de> + + PR lto/44950 + * g++.dg/lto/20101015-2_0.C: New testcase. + 2010-10-18 Jakub Jelinek <jakub@redhat.com> PR middle-end/46019 diff --git a/gcc/testsuite/g++.dg/lto/20101015-2_0.C b/gcc/testsuite/g++.dg/lto/20101015-2_0.C new file mode 100644 index 0000000..9015f53 --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/20101015-2_0.C @@ -0,0 +1,6 @@ +// { dg-lto-do link } +// { dg-lto-options { { -flto } { -g -flto } } } +// { dg-extra-ld-options "-r -nostdlib" } + +struct Base { ~Base (); }; +void fun(void) { struct Deriv : Base { } x; } @@ -4510,6 +4510,15 @@ free_lang_data_in_decl (tree decl) /* DECL_SAVED_TREE holds the GENERIC representation for DECL. At this point, it is not needed anymore. */ DECL_SAVED_TREE (decl) = NULL_TREE; + + /* Clear the abstract origin if it refers to a method. Otherwise + dwarf2out.c will ICE as we clear TYPE_METHODS and thus the + origin will not be output correctly. */ + if (DECL_ABSTRACT_ORIGIN (decl) + && DECL_CONTEXT (DECL_ABSTRACT_ORIGIN (decl)) + && RECORD_OR_UNION_TYPE_P + (DECL_CONTEXT (DECL_ABSTRACT_ORIGIN (decl)))) + DECL_ABSTRACT_ORIGIN (decl) = NULL_TREE; } else if (TREE_CODE (decl) == VAR_DECL) { |