]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ipa-strub: Replace cgraph_node order with uid.
authorMichal Jires <mjires@suse.cz>
Thu, 24 Oct 2024 00:04:12 +0000 (02:04 +0200)
committerMichal Jires <mjires@suse.cz>
Wed, 18 Dec 2024 17:15:16 +0000 (18:15 +0100)
ipa_strub_set_mode_for_new_functions uses node order as unique ever
increasing identifier. This is better satisfied with uid.
Order loses uniqueness with following patches.

gcc/ChangeLog:
* ipa-strub.cc (ipa_strub_set_mode_for_new_functions): Replace
order with uid.
(pass_ipa_strub_mode::execute): Likewise.

gcc/ipa-strub.cc

index f6e09cd50b6d2a773eff6ada6b6ad52f7637e9c4..29ba143b4620a8c00f8754970d4d0f2a2a323a61 100644 (file)
@@ -2257,16 +2257,16 @@ remove_named_attribute_unsharing (const char *name, tree *attrs)
     }
 }
 
-/* Record the order of the last cgraph entry whose mode we've already set, so
+/* Record the uid of the last cgraph entry whose mode we've already set, so
    that we can perform mode setting incrementally without duplication.  */
-static int last_cgraph_order;
+static int last_cgraph_uid;
 
 /* Set strub modes for functions introduced since the last call.  */
 
 static void
 ipa_strub_set_mode_for_new_functions ()
 {
-  if (symtab->order == last_cgraph_order)
+  if (symtab->cgraph_max_uid == last_cgraph_uid)
     return;
 
   cgraph_node *node;
@@ -2281,13 +2281,13 @@ ipa_strub_set_mode_for_new_functions ()
        continue;
 
       /*  Already done.  */
-      if (node->order < last_cgraph_order)
+      if (node->get_uid () < last_cgraph_uid)
        continue;
 
       set_strub_mode (node);
     }
 
-  last_cgraph_order = symtab->order;
+  last_cgraph_uid = symtab->cgraph_max_uid;
 }
 
 /* Return FALSE if NODE is a strub context, and TRUE otherwise.  */
@@ -2663,7 +2663,7 @@ pass_ipa_strub::adjust_at_calls_calls (cgraph_node *node)
 unsigned int
 pass_ipa_strub_mode::execute (function *)
 {
-  last_cgraph_order = 0;
+  last_cgraph_uid = 0;
   ipa_strub_set_mode_for_new_functions ();
 
   /* Verify before any inlining or other transformations.  */