diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2014-10-04 20:29:03 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2014-10-04 18:29:03 +0000 |
commit | 049e6d36cd8661e7dc1c7dc474cb6b1227543af6 (patch) | |
tree | 1163da82a2e60b73864668cdd54636ba6277fe01 /gcc/ipa-polymorphic-call.c | |
parent | 3daa7bbf7912030a760199f31a0926a11365a76f (diff) | |
download | gcc-049e6d36cd8661e7dc1c7dc474cb6b1227543af6.zip gcc-049e6d36cd8661e7dc1c7dc474cb6b1227543af6.tar.gz gcc-049e6d36cd8661e7dc1c7dc474cb6b1227543af6.tar.bz2 |
devirt-46.C: New testcase.
* g++.dg/ipa/devirt-46.C: New testcase.
* ipa-prop.c (ipa_compute_jump_functions_for_edge): Call
get_dynamic_type; drop TODO.
* ipa-polymorphic-call.c
(ipa_polymorphic_call_context::get_dynamic_type): Be ready
for otr_type to be unknown.
From-SVN: r215890
Diffstat (limited to 'gcc/ipa-polymorphic-call.c')
-rw-r--r-- | gcc/ipa-polymorphic-call.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/ipa-polymorphic-call.c b/gcc/ipa-polymorphic-call.c index a9b037a..ecbd78c 100644 --- a/gcc/ipa-polymorphic-call.c +++ b/gcc/ipa-polymorphic-call.c @@ -1390,12 +1390,13 @@ ipa_polymorphic_call_context::get_dynamic_type (tree instance, This is because we do not update INSTANCE when walking inwards. */ HOST_WIDE_INT instance_offset = offset; - otr_type = TYPE_MAIN_VARIANT (otr_type); + if (otr_type) + otr_type = TYPE_MAIN_VARIANT (otr_type); /* Walk into inner type. This may clear maybe_derived_type and save us from useless work. It also makes later comparsions with static type easier. */ - if (outer_type) + if (outer_type && otr_type) { if (!restrict_to_inner_class (otr_type)) return false; @@ -1484,8 +1485,9 @@ ipa_polymorphic_call_context::get_dynamic_type (tree instance, /* We look for vtbl pointer read. */ ao.size = POINTER_SIZE; ao.max_size = ao.size; - ao.ref_alias_set - = get_deref_alias_set (TREE_TYPE (BINFO_VTABLE (TYPE_BINFO (otr_type)))); + if (otr_type) + ao.ref_alias_set + = get_deref_alias_set (TREE_TYPE (BINFO_VTABLE (TYPE_BINFO (otr_type)))); if (dump_file) { |