From: Nathan Sidwell Date: Wed, 3 Jan 2018 16:01:31 +0000 (+0000) Subject: [PR c++/83667] Fix tree_dump ICE X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ce4734988f9ee022fbe5195f85ea04e7372a9eda;p=gcc.git [PR c++/83667] Fix tree_dump ICE https://gcc.gnu.org/ml/gcc-patches/2018-01/msg00148.html PR c++/83667 * method.c (make_alias_for): Copy DECL_CONTEXT. PR c++/83667 * g++.dg/ipa/pr83667.C: New. From-SVN: r256179 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 506684aeb47..4f8f8394273 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2018-01-03 Nathan Sidwell + + PR c++/83667 + * method.c (make_alias_for): Copy DECL_CONTEXT. + 2018-01-03 Marek Polacek PR c++/83592 diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 6b080c04fa2..55c84f12399 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -206,7 +206,7 @@ make_alias_for (tree target, tree newid) TREE_CODE (target), newid, TREE_TYPE (target)); DECL_LANG_SPECIFIC (alias) = DECL_LANG_SPECIFIC (target); cxx_dup_lang_specific_decl (alias); - DECL_CONTEXT (alias) = NULL; + DECL_CONTEXT (alias) = DECL_CONTEXT (target); TREE_READONLY (alias) = TREE_READONLY (target); TREE_THIS_VOLATILE (alias) = TREE_THIS_VOLATILE (target); TREE_PUBLIC (alias) = 0; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f389dea6971..e252ae0f080 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-01-03 Nathan Sidwell + + PR c++/83667 + * g++.dg/ipa/pr83667.C: New. + 2018-01-03 Martin Liska PR tree-optimization/83593 diff --git a/gcc/testsuite/g++.dg/ipa/pr83667.C b/gcc/testsuite/g++.dg/ipa/pr83667.C new file mode 100644 index 00000000000..5fbfa8eb0e4 --- /dev/null +++ b/gcc/testsuite/g++.dg/ipa/pr83667.C @@ -0,0 +1,23 @@ +/* { dg-options "-fdump-ipa-inline" } */ +// c++/83667 ICE dumping a static thunk + +struct a +{ + virtual ~a (); +}; + +struct b +{ + virtual void d (...); +}; + +struct c : a, b +{ + void d (...) + { + } +}; + +c c; + +// { dg-final { scan-ipa-dump "summary for void c::\\*.LTHUNK0" "inline" } }