https://gcc.gnu.org/g:76c882e341cb330a4e9f677a8c3541d573820255

commit r16-422-g76c882e341cb330a4e9f677a8c3541d573820255
Author: Martin Jambor <mjam...@suse.cz>
Date:   Tue May 6 17:28:44 2025 +0200

    ipa: Drop the default value of suffix parameter of create_clone (PR119852)
    
    In PR 119852 we agreed that since the NULL-ness of the suffix
    parameter should prevent creation of a record in the ipa-clones
    dump (which is implemented by a previous patch), it should not default
    to NULL.
    
    gcc/ChangeLog:
    
    2025-04-25  Martin Jambor  <mjam...@suse.cz>
    
            PR ipa/119852
            * cgraph.h (cgraph_node::create_clone): Remove the default value of
            argument suffix.  Update function comment.
            * cgraphclones.cc (cgraph_node::create_clone): Update function 
comment.
            * ipa-inline-transform.cc (clone_inlined_nodes): Pass NULL to suffix
            of create_clone explicitely.
            * ipa-inline.cc (recursive_inlining): Likewise.
            * lto-cgraph.cc (input_node): Likewise.

Diff:
---
 gcc/cgraph.h                | 10 +++++++---
 gcc/cgraphclones.cc         |  7 ++++++-
 gcc/ipa-inline-transform.cc |  2 +-
 gcc/ipa-inline.cc           |  2 +-
 gcc/lto-cgraph.cc           |  2 +-
 5 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index 1a59bf609b51..f4ee29e998c3 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -965,15 +965,19 @@ struct GTY((tag ("SYMTAB_FUNCTION"))) cgraph_node : 
public symtab_node
      If the new node is being inlined into another one, NEW_INLINED_TO should 
be
      the outline function the new one is (even indirectly) inlined to.
      All hooks will see this in node's inlined_to, when invoked.
-     Can be NULL if the node is not inlined.  SUFFIX is string that is appended
-     to the original name.  */
+     Should be NULL if the node is not inlined.
+
+     SUFFIX is string that is appended to the original name, it should only be
+     NULL if NEW_INLINED_TO is not NULL or if the clone being created is
+     temporary and a record about it should not be added into the ipa-clones
+     dump file.  */
   cgraph_node *create_clone (tree decl, profile_count count,
                             bool update_original,
                             vec<cgraph_edge *> redirect_callers,
                             bool call_duplication_hook,
                             cgraph_node *new_inlined_to,
                             ipa_param_adjustments *param_adjustments,
-                            const char *suffix = NULL);
+                            const char *suffix);
 
   /* Create callgraph node clone with new declaration.  The actual body will be
      copied later at compilation stage.  The name of the new clone will be
diff --git a/gcc/cgraphclones.cc b/gcc/cgraphclones.cc
index cb457e5f457f..b45ac4977331 100644
--- a/gcc/cgraphclones.cc
+++ b/gcc/cgraphclones.cc
@@ -366,9 +366,14 @@ localize_profile (cgraph_node *n)
 
    If the new node is being inlined into another one, NEW_INLINED_TO should be
    the outline function the new one is (even indirectly) inlined to.  All hooks
-   will see this in node's inlined_to, when invoked.  Can be NULL if the
+   will see this in node's inlined_to, when invoked.  Should be NULL if the
    node is not inlined.
 
+   SUFFIX is string that is appended to the original name, it should only be
+   NULL if NEW_INLINED_TO is not NULL or if the clone being created is
+   temporary and a record about it should not be added into the ipa-clones dump
+   file.
+
    If PARAM_ADJUSTMENTS is non-NULL, the parameter manipulation information
    will be overwritten by the new structure.  Otherwise the new node will
    share parameter manipulation information with the original node.  */
diff --git a/gcc/ipa-inline-transform.cc b/gcc/ipa-inline-transform.cc
index e00887be481b..46b8e5bb6790 100644
--- a/gcc/ipa-inline-transform.cc
+++ b/gcc/ipa-inline-transform.cc
@@ -225,7 +225,7 @@ clone_inlined_nodes (struct cgraph_edge *e, bool duplicate,
                                       e->count,
                                       update_original, vNULL, true,
                                       inlining_into,
-                                      NULL);
+                                      NULL, NULL);
          n->used_as_abstract_origin = e->callee->used_as_abstract_origin;
          e->redirect_callee (n);
        }
diff --git a/gcc/ipa-inline.cc b/gcc/ipa-inline.cc
index 38fdbfde1b3b..35e5496d8463 100644
--- a/gcc/ipa-inline.cc
+++ b/gcc/ipa-inline.cc
@@ -1865,7 +1865,7 @@ recursive_inlining (struct cgraph_edge *edge,
        {
          /* We need original clone to copy around.  */
          master_clone = node->create_clone (node->decl, node->count,
-           false, vNULL, true, NULL, NULL);
+           false, vNULL, true, NULL, NULL, NULL);
          for (e = master_clone->callees; e; e = e->next_callee)
            if (!e->inline_failed)
              clone_inlined_nodes (e, true, false, NULL);
diff --git a/gcc/lto-cgraph.cc b/gcc/lto-cgraph.cc
index 8439c51fb2bd..ec34f659d6a4 100644
--- a/gcc/lto-cgraph.cc
+++ b/gcc/lto-cgraph.cc
@@ -1303,7 +1303,7 @@ input_node (struct lto_file_decl_data *file_data,
     {
       node = dyn_cast<cgraph_node *> (nodes[clone_ref])->create_clone (fn_decl,
        profile_count::uninitialized (), false,
-       vNULL, false, NULL, NULL);
+       vNULL, false, NULL, NULL, NULL);
     }
   else
     {

Reply via email to