From: Martin Liska Date: Sun, 5 Apr 2015 17:17:29 +0000 (+0200) Subject: re PR middle-end/65665 (g++.dg/torture/pr64378.C -O2 -flto -fno-use-linker-plugin... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8fc8c7e7d14ff1b9891b6de2d2bbe51ad5af4f70;p=gcc.git re PR middle-end/65665 (g++.dg/torture/pr64378.C -O2 -flto -fno-use-linker-plugin -flto-partition=none) Fix PR ipa/65665 PR ipa/65665 * ipa-icf.c (sem_function::equals_wpa): Verify that IPA CP has computed data structure. (sem_item_optimizer::update_hash_by_addr_refs): Likewise. From-SVN: r221872 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a0e973bef36..f9cb04c39b4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2015-04-05 Martin Liska + + PR ipa/65665 + * ipa-icf.c (sem_function::equals_wpa): Verify that IPA CP + has computed data structure. + (sem_item_optimizer::update_hash_by_addr_refs): Likewise. + 2015-04-04 Jan Hubicka * invoke.texi (inline-unit-growth): Increase growth to 20% diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c index 8626730dca8..8f8a0cf3463 100644 --- a/gcc/ipa-icf.c +++ b/gcc/ipa-icf.c @@ -535,7 +535,8 @@ sem_function::equals_wpa (sem_item *item, && (TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE || TREE_CODE (TREE_TYPE (item->decl)) == METHOD_TYPE) && (ipa_node_params_sum == NULL - || ipa_is_param_used (IPA_NODE_REF (dyn_cast (node)), + || IPA_NODE_REF (get_node ())->descriptors.is_empty () + || ipa_is_param_used (IPA_NODE_REF (get_node ()), 0)) && compare_polymorphic_p ()) { @@ -2501,14 +2502,15 @@ sem_item_optimizer::update_hash_by_addr_refs () m_items[i]->update_hash_by_addr_refs (m_symtab_node_map); if (m_items[i]->type == FUNC) { + cgraph_node *cnode = dyn_cast (m_items[i]->node); + if (TREE_CODE (TREE_TYPE (m_items[i]->decl)) == METHOD_TYPE && contains_polymorphic_type_p (method_class_type (TREE_TYPE (m_items[i]->decl))) && (DECL_CXX_CONSTRUCTOR_P (m_items[i]->decl) || ((ipa_node_params_sum == NULL - || ipa_is_param_used ( - IPA_NODE_REF - (dyn_cast (m_items[i]->node)), 0)) + || IPA_NODE_REF (cnode)->descriptors.is_empty () + || ipa_is_param_used (IPA_NODE_REF (cnode), 0)) && static_cast (m_items[i]) ->compare_polymorphic_p ()))) {