re PR ipa/65557 (ICE: SIGSEGV in hash_table<>::find_slot_with_hash() with -fdevirtual...
authorMartin Liska <mliska@suse.cz>
Tue, 31 Mar 2015 16:03:03 +0000 (18:03 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Tue, 31 Mar 2015 16:03:03 +0000 (16:03 +0000)
Fix PR65557.

* ipa-icf.c (sem_function::equals_wpa): Check if IPA CP
has already filled up function summary.
(sem_item_optimizer::update_hash_by_addr_refs): Likewise.
* g++.dg/ipa/pr65557.C: New test.

From-SVN: r221796

gcc/ChangeLog
gcc/ipa-icf.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ipa/pr65557.C [new file with mode: 0644]

index e37abf98162c6a606aeab1adcd320f2170f43e1d..150525b7ba9429e13db126e0b4656737ac9325bb 100644 (file)
@@ -1,3 +1,10 @@
+2015-03-31  Martin Liska  <mliska@suse.cz>
+
+       PR ipa/65557
+       * ipa-icf.c (sem_function::equals_wpa): Check if IPA CP
+       has already filled up function summary.
+       (sem_item_optimizer::update_hash_by_addr_refs): Likewise.
+
 2015-03-31  Richard Biener  <rguenther@suse.de>
 
        * tree-sra.c (create_access_replacement): Drop under-/over-alignment
index ad868e10c0487a84daba607da7932b1f93886bce..8626730dca840817c1e19551fa5e690273578fb2 100644 (file)
@@ -534,7 +534,7 @@ sem_function::equals_wpa (sem_item *item,
   if (opt_for_fn (decl, flag_devirtualize)
       && (TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE
           || TREE_CODE (TREE_TYPE (item->decl)) == METHOD_TYPE)
-      && (!flag_ipa_cp
+      && (ipa_node_params_sum == NULL
          || ipa_is_param_used (IPA_NODE_REF (dyn_cast <cgraph_node *>(node)),
                                0))
       && compare_polymorphic_p ())
@@ -2505,7 +2505,7 @@ sem_item_optimizer::update_hash_by_addr_refs ()
              && contains_polymorphic_type_p
                   (method_class_type (TREE_TYPE (m_items[i]->decl)))
              && (DECL_CXX_CONSTRUCTOR_P (m_items[i]->decl)
-                 || ((!flag_ipa_cp
+                 || ((ipa_node_params_sum == NULL
                       || ipa_is_param_used (
                            IPA_NODE_REF
                              (dyn_cast <cgraph_node *>(m_items[i]->node)), 0))
index b6236369291e1819ad8558a4525e1e45340b1a05..5d0d3b4f73fc4acd139d813693b4428fad0ff905 100644 (file)
@@ -1,3 +1,7 @@
+2015-03-31  Martin Liska  <mliska@suse.cz>
+
+       * g++.dg/ipa/pr65557.C: New test.
+
 2015-03-31  Dominik Vogt  <vogt@linux.vnet.ibm.com>
 
        * gcc.target/s390/hotpatch-25.c: New test.
diff --git a/gcc/testsuite/g++.dg/ipa/pr65557.C b/gcc/testsuite/g++.dg/ipa/pr65557.C
new file mode 100644 (file)
index 0000000..2250bb0
--- /dev/null
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-ipa-icf-details"  } */
+
+struct S0
+{
+  S0 ()
+  {
+  }
+};
+
+struct S1
+{
+  S1 ()
+  {
+  }
+};
+
+S0 s0;
+S1 s1;