https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63892

--- Comment #22 from Iain Sandoe <iains at gcc dot gnu.org> ---
yeah, it's not right yet.. looking at this:
diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c
index e1af8bf..3b5553e 100644
--- a/gcc/ipa-icf.c
+++ b/gcc/ipa-icf.c
@@ -658,13 +658,16 @@ sem_function::merge (sem_item *alias_item)
       create_thunk = !stdarg_p (TREE_TYPE (alias->decl));
       create_alias = false;
       /* When both alias and original are not overwritable, we can save
-         the extra thunk wrapper for direct calls.  */
+         the extra thunk wrapper for direct calls (providing that there
+         are no other referring entries).  */
       redirect_callers
        = (!original_discardable
           && !DECL_COMDAT_GROUP (alias->decl)
           && alias->get_availability () > AVAIL_INTERPOSABLE
           && original->get_availability () > AVAIL_INTERPOSABLE
-          && !alias->instrumented_version);
+          && !alias->instrumented_version
+          && alias->ref_list.referring.is_empty()
+         );
     }
   else
     {

Reply via email to