diff options
author | Jan Hubicka <jh@suse.cz> | 2018-10-26 11:32:47 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2018-10-26 09:32:47 +0000 |
commit | abb967da1c0d6deb98de488213aaaa06a785adc5 (patch) | |
tree | 0364fb377420f21af8a467863bd493d85edea497 /gcc/ipa-devirt.c | |
parent | a1f072e2441c58f6a486f90bb9a32bd5f6c51cb4 (diff) | |
download | gcc-abb967da1c0d6deb98de488213aaaa06a785adc5.zip gcc-abb967da1c0d6deb98de488213aaaa06a785adc5.tar.gz gcc-abb967da1c0d6deb98de488213aaaa06a785adc5.tar.bz2 |
ipa-devirt.c (odr_subtypes_equivalent_p): Fix recursion.
* ipa-devirt.c (odr_subtypes_equivalent_p): Fix recursion.
(warn_types_mismatch): Fix walk of DECL_NAME.
(odr_types_equivalent_p): Fix overactive assert.
* lto/lto-symtab.c (lto_symtab_merge_decls_2): Fix extra space.
* g++.dg/lto/odr-1_0.C: Fix template.
* g++.dg/lto/odr-1_1.C: Fix template.
From-SVN: r265523
Diffstat (limited to 'gcc/ipa-devirt.c')
-rw-r--r-- | gcc/ipa-devirt.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c index df880fe..d92e6f4 100644 --- a/gcc/ipa-devirt.c +++ b/gcc/ipa-devirt.c @@ -719,9 +719,10 @@ odr_subtypes_equivalent_p (tree t1, tree t2, bool warn, bool *warned, } if (visited->add (pair)) return true; - if (odr_types_equivalent_p (TYPE_MAIN_VARIANT (t1), TYPE_MAIN_VARIANT (t2), - false, NULL, visited, loc1, loc2) - && !type_variants_equivalent_p (t1, t2, warn, warned)) + if (!odr_types_equivalent_p (TYPE_MAIN_VARIANT (t1), TYPE_MAIN_VARIANT (t2), + false, NULL, visited, loc1, loc2)) + return false; + if (!type_variants_equivalent_p (t1, t2, warn, warned)) return false; return true; } @@ -1138,7 +1139,7 @@ warn_types_mismatch (tree t1, tree t2, location_t loc1, location_t loc2) if (TREE_CODE (n1) == TYPE_DECL) n1 = DECL_NAME (n1); if (TREE_CODE (n2) == TYPE_DECL) - n1 = DECL_NAME (n2); + n2 = DECL_NAME (n2); /* Most of the time, the type names will match, do not be unnecesarily verbose. */ if (IDENTIFIER_POINTER (n1) != IDENTIFIER_POINTER (n2)) @@ -1292,10 +1293,6 @@ odr_types_equivalent_p (tree t1, tree t2, bool warn, bool *warned, /* Check first for the obvious case of pointer identity. */ if (t1 == t2) return true; - gcc_assert (!type_with_linkage_p (TYPE_MAIN_VARIANT (t1)) - || !type_in_anonymous_namespace_p (TYPE_MAIN_VARIANT (t1))); - gcc_assert (!type_with_linkage_p (TYPE_MAIN_VARIANT (t2)) - || !type_in_anonymous_namespace_p (TYPE_MAIN_VARIANT (t2))); /* Can't be the same type if the types don't have the same code. */ if (TREE_CODE (t1) != TREE_CODE (t2)) |