diff options
author | Jan Hubicka <jh@suse.cz> | 2019-07-02 10:23:02 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2019-07-02 08:23:02 +0000 |
commit | 606a9a8c728f2dae6b9d58397fcefb3cb0fa0db8 (patch) | |
tree | 3612193ad94598df1e8f631ae0b5c37ae195bc3a /gcc/lto | |
parent | 14ec49a7537004633b7fff859178cbebd288ca1d (diff) | |
download | gcc-606a9a8c728f2dae6b9d58397fcefb3cb0fa0db8.zip gcc-606a9a8c728f2dae6b9d58397fcefb3cb0fa0db8.tar.gz gcc-606a9a8c728f2dae6b9d58397fcefb3cb0fa0db8.tar.bz2 |
lto-common.c (lto_register_canonical_types_for_odr_types): Copy CXX_ODR_P from the main variant.
* lto-common.c (lto_register_canonical_types_for_odr_types):
Copy CXX_ODR_P from the main variant.
From-SVN: r272923
Diffstat (limited to 'gcc/lto')
-rw-r--r-- | gcc/lto/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/lto/lto-common.c | 13 |
2 files changed, 16 insertions, 2 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index e853f5c..ae4e157 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,5 +1,10 @@ 2019-06-27 Jan Hubicka <jh@suse.cz> + * lto-common.c (lto_register_canonical_types_for_odr_types): + Copy CXX_ODR_P from the main variant. + +2019-06-27 Jan Hubicka <jh@suse.cz> + * lto-common.c: tree-pretty-print.h (type_streaming_finished): New static var. (gimple_register_canonical_type_1): Return updated hash; handle ODR diff --git a/gcc/lto/lto-common.c b/gcc/lto/lto-common.c index 1275b67..2b3165a 100644 --- a/gcc/lto/lto-common.c +++ b/gcc/lto/lto-common.c @@ -568,8 +568,17 @@ lto_register_canonical_types_for_odr_types () /* Register all remaining types. */ FOR_EACH_VEC_ELT (*types_to_register, i, t) - if (!TYPE_CANONICAL (t)) - gimple_register_canonical_type (t); + { + /* For pre-streamed types like va-arg it is possible that main variant + is !CXX_ODR_P while the variant (which is streamed) is. + Copy CXX_ODR_P to make type verifier happy. This is safe because + in canonical type calculation we only consider main variants. + However we can not change this flag before streaming is finished + to not affect tree merging. */ + TYPE_CXX_ODR_P (t) = TYPE_CXX_ODR_P (TYPE_MAIN_VARIANT (t)); + if (!TYPE_CANONICAL (t)) + gimple_register_canonical_type (t); + } } |