aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-ref.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2015-02-26 21:21:38 +0100
committerMartin Liska <marxin@gcc.gnu.org>2015-02-26 20:21:38 +0000
commit5ebd0e6155dcb7ebecf278731aad189be79bb456 (patch)
tree31bd542ab4137d5e5826c62a637c3f0f03c24b46 /gcc/ipa-ref.c
parentff5ed3f6def9e24f907c6b9df66b9a582b327ac9 (diff)
downloadgcc-5ebd0e6155dcb7ebecf278731aad189be79bb456.zip
gcc-5ebd0e6155dcb7ebecf278731aad189be79bb456.tar.gz
gcc-5ebd0e6155dcb7ebecf278731aad189be79bb456.tar.bz2
re PR lto/64693 (PCH failed with --with-build-config=bootstrap-lto)
Fix PR ipa/64693 PR ipa/64693 * ipa-icf.c (symbol_compare_collection::symbol_compare_collection): New. (sem_item_optimizer::subdivide_classes_by_sensitive_refs): New function. (sem_item_optimizer::process_cong_reduction): Include division by sensitive references. * ipa-icf.h (struct symbol_compare_hashmap_traits): New class. * ipa-ref.c (ipa_ref::address_matters_p): New function. * ipa-ref.h (ipa_ref::address_matters_p): Likewise. * g++.dg/ipa/pr64146.C: Update expected results. * gcc.dg/ipa/ipa-icf-26.c: Update test. * gcc.dg/ipa/ipa-icf-33.c: Remove redundant line. * gcc.dg/ipa/ipa-icf-34.c: New test. Co-Authored-By: Jan Hubicka <hubicka@ucw.cz> From-SVN: r221031
Diffstat (limited to 'gcc/ipa-ref.c')
-rw-r--r--gcc/ipa-ref.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/ipa-ref.c b/gcc/ipa-ref.c
index 91c2f89..f9af352 100644
--- a/gcc/ipa-ref.c
+++ b/gcc/ipa-ref.c
@@ -124,3 +124,23 @@ ipa_ref::referred_ref_list (void)
{
return &referred->ref_list;
}
+
+/* Return true if refernece may be used in address compare. */
+bool
+ipa_ref::address_matters_p ()
+{
+ if (use != IPA_REF_ADDR)
+ return false;
+ /* Addresses taken from virtual tables are never compared. */
+ if (is_a <varpool_node *> (referring)
+ && DECL_VIRTUAL_P (referring->decl))
+ return false;
+ /* Address of virtual tables and functions is never compared. */
+ if (DECL_VIRTUAL_P (referred->decl))
+ return false;
+ /* Address of C++ cdtors is never compared. */
+ if (is_a <cgraph_node *> (referred)
+ && (DECL_CXX_CONSTRUCTOR_P (referred->decl) || DECL_CXX_DESTRUCTOR_P (referred->decl)))
+ return false;
+ return true;
+}