Do not remove ifunc_resolver in LTO.
authorMartin Liska <mliska@suse.cz>
Mon, 27 Apr 2020 04:44:29 +0000 (06:44 +0200)
committerMartin Liska <mliska@suse.cz>
Mon, 27 Apr 2020 04:44:29 +0000 (06:44 +0200)
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.

gcc/ChangeLog
gcc/cgraph.h

index 36b5720756a3a208466ee3084ceef306d4ebf09d..54cc55c5e8d2d95f605ebd3d5454d9da89809fe0 100644 (file)
@@ -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
index 43de3b4a8acb8dbcdf54472d2c3d9967b942e51c..5ddeb65269bd69b75a52ab5236ed9d83a102a31f 100644 (file)
@@ -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;