Since starting from GCC 15 the order is not unique for any
symtab_nodes but m_uid is, I believe we ought to dump the latter in
the ipa-clones dump, if only so that people can reliably match entries
about new clones to those about removed nodes (if any).
This patch also contains a fixes to a few other places where we have
so far dumped order to our ordinary dumps and which have been
identified by Michal Jires.
gcc/ChangeLog:
2025-05-16 Martin Jambor <mjambor@suse.cz>
* cgraph.h (symtab_node): Make member function get_uid const.
* cgraphclones.cc (dump_callgraph_transformation): Dump m_uid of the
call graph nodes instead of order.
* cgraph.cc (cgraph_node::remove): Likewise.
* ipa-cp.cc (ipcp_lattice<valtype>::print): Likewise.
* ipa-sra.cc (ipa_sra_summarize_function): Likewise.
* symtab.cc (symtab_node::dump_base): Likewise.
Co-Authored-By: Michal Jires <mjires@suse.cz>
(cherry picked from commit
9fa534f0831892393885e64596a0d6ca8c4078b6)
clone_info *info, saved_info;
if (symtab->ipa_clones_dump_file && symtab->cloned_nodes.contains (this))
fprintf (symtab->ipa_clones_dump_file,
- "Callgraph removal;%s;%d;%s;%d;%d\n", asm_name (), order,
+ "Callgraph removal;%s;%d;%s;%d;%d\n", asm_name (), get_uid (),
DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl),
DECL_SOURCE_COLUMN (decl));
static inline void checking_verify_symtab_nodes (void);
/* Get unique identifier of the node. */
- inline int get_uid ()
+ inline int get_uid () const
{
return m_uid;
}
{
fprintf (symtab->ipa_clones_dump_file,
"Callgraph clone;%s;%d;%s;%d;%d;%s;%d;%s;%d;%d;%s\n",
- original->asm_name (), original->order,
+ original->asm_name (), original->get_uid (),
DECL_SOURCE_FILE (original->decl),
DECL_SOURCE_LINE (original->decl),
DECL_SOURCE_COLUMN (original->decl), clone->asm_name (),
- clone->order, DECL_SOURCE_FILE (clone->decl),
+ clone->get_uid (), DECL_SOURCE_FILE (clone->decl),
DECL_SOURCE_LINE (clone->decl), DECL_SOURCE_COLUMN (clone->decl),
suffix);
else
fprintf (f, " [scc: %i, from:", val->scc_no);
for (s = val->sources; s; s = s->next)
- fprintf (f, " %i(%f)", s->cs->caller->order,
+ fprintf (f, " %i(%f)", s->cs->caller->get_uid (),
s->cs->sreal_frequency ().to_double ());
fprintf (f, "]");
}
{
if (dump_file)
fprintf (dump_file, "Creating summary for %s/%i:\n", node->name (),
- node->order);
+ node->get_uid ());
gcc_obstack_init (&gensum_obstack);
loaded_decls = new hash_set<tree>;
same_comdat_group->dump_asm_name ());
if (next_sharing_asm_name)
fprintf (f, " next sharing asm name: %i\n",
- next_sharing_asm_name->order);
+ next_sharing_asm_name->get_uid ());
if (previous_sharing_asm_name)
fprintf (f, " previous sharing asm name: %i\n",
- previous_sharing_asm_name->order);
+ previous_sharing_asm_name->get_uid ());
if (address_taken)
fprintf (f, " Address is taken.\n");