From: Jan Hubicka Date: Thu, 1 Nov 2018 13:03:28 +0000 (+0100) Subject: tree.c (free_lang_data_in_decl): Free TREE_TYPE and alignment of TYPE_DECL. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6d912664f483fb6995240c043caa000a242e0bf8;p=gcc.git tree.c (free_lang_data_in_decl): Free TREE_TYPE and alignment of TYPE_DECL. * tree.c (free_lang_data_in_decl): Free TREE_TYPE and alignment of TYPE_DECL. * g++.dg/lto/pr84805_1.C: Update template. * g++.dg/lto/pr84805_0.C: Update template. * g++.dg/lto/pr84805_1b.C: Update template. * g++.dg/lto/pr84805_0b.C: Update template. From-SVN: r265722 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2dbe48063a9..4e778e48ef9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2018-11-30 Jan Hubicka + + * g++.dg/lto/pr84805_1.C: Update template. + * g++.dg/lto/pr84805_0.C: Update template. + * g++.dg/lto/pr84805_1b.C: Update template. + * g++.dg/lto/pr84805_0b.C: Update template. + 2018-11-01 Jakub Jelinek PR tree-optimization/87826 diff --git a/gcc/testsuite/g++.dg/lto/pr84805_1.C b/gcc/testsuite/g++.dg/lto/pr84805_1.C index b1310b7c77c..7cfb93650be 100644 --- a/gcc/testsuite/g++.dg/lto/pr84805_1.C +++ b/gcc/testsuite/g++.dg/lto/pr84805_1.C @@ -3,7 +3,7 @@ public: virtual ~XclRoot(); }; class XclImpRoot : XclRoot {}; -struct RootData { // { dg-lto-warning "8: type 'struct RootData' violates the C\\+\\+ One Definition Rule" } +struct RootData { XclImpRoot pIR; }; class ExcRoot { diff --git a/gcc/testsuite/g++.dg/lto/pr85405_0.C b/gcc/testsuite/g++.dg/lto/pr85405_0.C index 1d46ea94ba5..09b70fca189 100644 --- a/gcc/testsuite/g++.dg/lto/pr85405_0.C +++ b/gcc/testsuite/g++.dg/lto/pr85405_0.C @@ -3,7 +3,7 @@ // { dg-require-effective-target fpic } // { dg-lto-options {{-fPIC -shared -flto}} } -class VclReferenceBase { // { dg-lto-warning "7: type 'struct VclReferenceBase' violates the C\\+\\+ One Definition Rule" } +class VclReferenceBase { int mnRefCnt; bool mbDisposed : 1; virtual ~VclReferenceBase(); diff --git a/gcc/testsuite/g++.dg/lto/pr85405b_0.C b/gcc/testsuite/g++.dg/lto/pr85405b_0.C index a986a1f6f74..201142bc1a3 100644 --- a/gcc/testsuite/g++.dg/lto/pr85405b_0.C +++ b/gcc/testsuite/g++.dg/lto/pr85405b_0.C @@ -3,7 +3,7 @@ // { dg-require-effective-target fpic } // { dg-lto-options {{-fPIC -shared -flto}} } -class VclReferenceBase { // { dg-lto-warning "7: type 'struct VclReferenceBase' violates the C\\+\\+ One Definition Rule" } +class VclReferenceBase { int mnRefCnt; int mbDisposed : 3; virtual ~VclReferenceBase(); diff --git a/gcc/testsuite/g++.dg/lto/pr85405b_1.C b/gcc/testsuite/g++.dg/lto/pr85405b_1.C index fd98e631d56..5504c67cf64 100644 --- a/gcc/testsuite/g++.dg/lto/pr85405b_1.C +++ b/gcc/testsuite/g++.dg/lto/pr85405b_1.C @@ -1,6 +1,6 @@ class VclReferenceBase { int mnRefCnt; - int mbDisposed: 7; // { dg-lto-message "19: a field of same name but different type is defined in another translation unit" } + int mbDisposed: 7; protected: virtual ~VclReferenceBase(); diff --git a/gcc/tree.c b/gcc/tree.c index 472b6082be9..069d62d51be 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -5510,6 +5510,8 @@ free_lang_data_in_decl (tree decl, struct free_lang_data_d *fld) DECL_VISIBILITY_SPECIFIED (decl) = 0; DECL_INITIAL (decl) = NULL_TREE; DECL_ORIGINAL_TYPE (decl) = NULL_TREE; + TREE_TYPE (decl) = void_type_node; + SET_DECL_ALIGN (decl, 0); } else if (TREE_CODE (decl) == FIELD_DECL) {