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

--- Comment #27 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
So:
--- gcc/ipa-icf.cc.jj   2024-02-10 11:25:09.645478952 +0100
+++ gcc/ipa-icf.cc      2024-02-14 10:44:27.906216458 +0100
@@ -1244,6 +1244,29 @@ sem_function::merge (sem_item *alias_ite
   else
     create_alias = true;

+  unsigned i;
+  tree name;
+  FOR_EACH_SSA_NAME (i, name, original->get_fun ())
+    {
+      /* We need to either merge or reset SSA_NAME_*_INFO.
+        For merging we don't preserve the mapping between
+        original and alias SSA_NAMEs from successful equals
+        calls.  */
+      if (POINTER_TYPE_P (TREE_TYPE (name)))
+        {
+         if (SSA_NAME_PTR_INFO (name))
+           {
+             gcc_assert (!flag_wpa);
+             SSA_NAME_PTR_INFO (name) = NULL;
+           }
+        }
+      else if (SSA_NAME_RANGE_INFO (name))
+       {
+         gcc_assert (!flag_wpa);
+         SSA_NAME_RANGE_INFO (name) = NULL;
+       }
+    }
+
   if (redirect_callers)
     {
       int nredirected = redirect_all_callers (alias, local_original);
then?  For the merging, I guess we'd need to move one of the 2 vec<int> vectors
from m_checker to the sem_function instead of throwing it away in
sem_function::equals
if returning true.

Reply via email to