class.c (layout_class_type): Set TYPE_CXX_ODR_P for as-base type copy.
authorJan Hubicka <jh@suse.cz>
Thu, 27 Jun 2019 12:07:43 +0000 (14:07 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Thu, 27 Jun 2019 12:07:43 +0000 (12:07 +0000)
commita0276c00934da47fa511aa52e1973b68ffd8b2ab
tree665e4f690d6caafce10b0ade27ecfeef5909742f
parentef874db611879d5004e1d834543e55d31f2bfe1c
class.c (layout_class_type): Set TYPE_CXX_ODR_P for as-base type copy.

* class.c (layout_class_type): Set TYPE_CXX_ODR_P for as-base
type copy.

* ipa-devirt.c (odr_type_d): Add tbaa_enabled flag.
(add_type_duplicate): When odr hash is not allocated, to nothing.
(odr_based_tbaa_p): New function.
(set_type_canonical_for_odr_type): New function.
* ipa-utils.h (enable_odr_based_tbaa, odr_based_tbaa_p,
set_type_canonical_for_odr_type): New.
* tree.c (gimple_canonical_types_compatible_p): ODR types with
ODR based TBAA are not equivalent to non-ODR types.

* lto-common.c: Include demangle.h and tree-pretty-print.h
(type_streaming_finished): New static var.
(gimple_register_canonical_type_1): Return updated hash; handle ODR
types.
(iterative_hash_canonical_type): Update use of
gimple_register_canonical_type_1.

* g++.dg/lto/alias-2_0.C: New testcase.
* g++.dg/lto/alias-2_1.C: New testcase.

From-SVN: r272749
gcc/ChangeLog
gcc/cp/ChangeLog
gcc/cp/class.c
gcc/ipa-devirt.c
gcc/ipa-utils.h
gcc/lto/lto-common.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/lto/alias-2_0.C [new file with mode: 0644]
gcc/testsuite/g++.dg/lto/alias-2_1.C [new file with mode: 0644]
gcc/tree.c