re PR middle-end/65665 (g++.dg/torture/pr64378.C -O2 -flto -fno-use-linker-plugin...
authorMartin Liska <mliska@suse.cz>
Sun, 5 Apr 2015 17:17:29 +0000 (19:17 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Sun, 5 Apr 2015 17:17:29 +0000 (17:17 +0000)
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

gcc/ChangeLog
gcc/ipa-icf.c

index a0e973bef367ce384eca7562f1d3b27846caa99a..f9cb04c39b488a86f180252131686a6aeab751ef 100644 (file)
@@ -1,3 +1,10 @@
+2015-04-05  Martin Liska  <mliska@suse.cz>
+
+       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  <hubicka@ucw.cz>
 
        * invoke.texi (inline-unit-growth): Increase growth to 20%
index 8626730dca840817c1e19551fa5e690273578fb2..8f8a0cf34636d57188bc52242fd98241ad3ea9a8 100644 (file)
@@ -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 <cgraph_node *>(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 <cgraph_node *> (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 <cgraph_node *>(m_items[i]->node)), 0))
+                      || IPA_NODE_REF (cnode)->descriptors.is_empty ()
+                      || ipa_is_param_used (IPA_NODE_REF (cnode), 0))
                      && static_cast<sem_function *> (m_items[i])
                           ->compare_polymorphic_p ())))
             {