aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-devirt.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2015-04-30 06:43:32 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2015-04-30 04:43:32 +0000
commit32496fdde11abfeda4bd911c489fdda5f3e141e6 (patch)
treeb983c60b589ae306425cb0067163d88f62953c25 /gcc/ipa-devirt.c
parent00c1cf38e148cdbd57d350e240684181dac01091 (diff)
downloadgcc-32496fdde11abfeda4bd911c489fdda5f3e141e6.zip
gcc-32496fdde11abfeda4bd911c489fdda5f3e141e6.tar.gz
gcc-32496fdde11abfeda4bd911c489fdda5f3e141e6.tar.bz2
ipa-devirt.c (odr_subtypes_equivalent_p): Compare TYPE_NAME only for aggregate types.
* ipa-devirt.c (odr_subtypes_equivalent_p): Compare TYPE_NAME only for aggregate types. (register_odr_type): Be ready for MAIN_VARIANT of ODR type type to be non_ODR. * tree.c (need_assembler_name_p): Compute mangled name for non-fundamental types and integer types. From-SVN: r222609
Diffstat (limited to 'gcc/ipa-devirt.c')
-rw-r--r--gcc/ipa-devirt.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c
index 7214a74..aacc59c 100644
--- a/gcc/ipa-devirt.c
+++ b/gcc/ipa-devirt.c
@@ -675,7 +675,8 @@ odr_subtypes_equivalent_p (tree t1, tree t2,
have to be compared structurally. */
if (TREE_CODE (t1) != TREE_CODE (t2))
return false;
- if ((TYPE_NAME (t1) == NULL_TREE) != (TYPE_NAME (t2) == NULL_TREE))
+ if (AGGREGATE_TYPE_P (t1)
+ && (TYPE_NAME (t1) == NULL_TREE) != (TYPE_NAME (t2) == NULL_TREE))
return false;
type_pair pair={t1,t2};
@@ -2029,10 +2030,14 @@ register_odr_type (tree type)
if (in_lto_p)
odr_vtable_hash = new odr_vtable_hash_type (23);
}
- /* Arrange things to be nicer and insert main variants first. */
- if (odr_type_p (TYPE_MAIN_VARIANT (type)))
+ /* Arrange things to be nicer and insert main variants first.
+ ??? fundamental prerecorded types do not have mangled names; this
+ makes it possible that non-ODR type is main_odr_variant of ODR type.
+ Things may get smoother if LTO FE set mangled name of those types same
+ way as C++ FE does. */
+ if (odr_type_p (main_odr_variant (TYPE_MAIN_VARIANT (type))))
get_odr_type (TYPE_MAIN_VARIANT (type), true);
- if (TYPE_MAIN_VARIANT (type) != type)
+ if (TYPE_MAIN_VARIANT (type) != type && odr_type_p (main_odr_variant (type)))
get_odr_type (type, true);
}