diff options
author | Nathan Sidwell <nathan@acm.org> | 2018-01-03 16:01:31 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2018-01-03 16:01:31 +0000 |
commit | ce4734988f9ee022fbe5195f85ea04e7372a9eda (patch) | |
tree | c697e1a3cc5365d89d311a21bd8e38d5ecaab0f5 /gcc | |
parent | fa9544ab4df0e88946488fb82f4b994bf36a97ff (diff) | |
download | gcc-ce4734988f9ee022fbe5195f85ea04e7372a9eda.zip gcc-ce4734988f9ee022fbe5195f85ea04e7372a9eda.tar.gz gcc-ce4734988f9ee022fbe5195f85ea04e7372a9eda.tar.bz2 |
[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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/method.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ipa/pr83667.C | 23 |
4 files changed, 34 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 506684a..4f8f839 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2018-01-03 Nathan Sidwell <nathan@acm.org> + + PR c++/83667 + * method.c (make_alias_for): Copy DECL_CONTEXT. + 2018-01-03 Marek Polacek <polacek@redhat.com> PR c++/83592 diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 6b080c0..55c84f1 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 f389dea..e252ae0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-01-03 Nathan Sidwell <nathan@acm.org> + + PR c++/83667 + * g++.dg/ipa/pr83667.C: New. + 2018-01-03 Martin Liska <mliska@suse.cz> 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 0000000..5fbfa8e --- /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" } } |