aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2020-04-27 06:44:29 +0200
committerMartin Liska <mliska@suse.cz>2020-04-27 06:44:29 +0200
commitb9dbb436b70938ca2b1ddf0cf2d5ffe2e5725dea (patch)
treeb8eecc7d293ad6f280c5bae9ebf02e33880c390b
parentf6955089db6c3aa63c276704159ffad1ef15d256 (diff)
downloadgcc-b9dbb436b70938ca2b1ddf0cf2d5ffe2e5725dea.zip
gcc-b9dbb436b70938ca2b1ddf0cf2d5ffe2e5725dea.tar.gz
gcc-b9dbb436b70938ca2b1ddf0cf2d5ffe2e5725dea.tar.bz2
Do not remove ifunc_resolver in LTO.
PR lto/94659 * cgraph.h (cgraph_node::can_remove_if_no_direct_calls_and_refs_p): Do not remove ifunc_resolvers in remove unreachable nodes in LTO.
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/cgraph.h2
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 36b5720..54cc55c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2020-04-27 Martin Liska <mliska@suse.cz>
+
+ PR lto/94659
+ * cgraph.h (cgraph_node::can_remove_if_no_direct_calls_and_refs_p):
+ Do not remove ifunc_resolvers in remove unreachable nodes in LTO.
+
2020-04-27 Xiong Hu Luo <luoxhu@linux.ibm.com>
PR target/91518
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index 43de3b4..5ddeb65 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -3162,7 +3162,7 @@ cgraph_node::can_remove_if_no_direct_calls_and_refs_p (void)
return false;
/* Only COMDAT functions can be removed if externally visible. */
if (externally_visible
- && (!DECL_COMDAT (decl)
+ && ((!DECL_COMDAT (decl) || ifunc_resolver)
|| forced_by_abi
|| used_from_object_file_p ()))
return false;