From 4f6a5f07a0b8d3a90ec3c9bc93f5fb5c547f219a Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 3 Jan 2018 16:01:31 +0000 Subject: [PATCH] [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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@256179 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/method.c | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/ipa/pr83667.C | 23 +++++++++++++++++++++++ 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/ipa/pr83667.C 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" } } -- 2.11.4.GIT