https://gcc.gnu.org/g:5023e169fbac0105e690692d3c1e7e3677190df7
commit r17-5622-g5023e169fbac0105e690692d3c1e7e3677190df7 Author: Josef Melcr <[email protected]> Date: Thu Sep 10 16:35:53 2026 +0200 cgraph: Move printing logic to include callback edges This dump used to be after callback edges were redirected, leaving them without a mention. I want to include them in the dumps, so I moved the printing sequence in patch to before the callback redirection. gcc/ChangeLog: * cgraph.cc (cgraph_edge::redirect_call_stmt_to_callee): Move the printing logic before the callback edge branch, so that they are also included in the dump. Signed-off-by: Josef Melcr <[email protected]> Diff: --- gcc/cgraph.cc | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/gcc/cgraph.cc b/gcc/cgraph.cc index 63e660262931..184b741b1be2 100644 --- a/gcc/cgraph.cc +++ b/gcc/cgraph.cc @@ -1837,6 +1837,17 @@ cgraph_edge::redirect_call_stmt_to_callee (cgraph_edge *e, || decl == e->callee->decl) return e->call_stmt; + clone_info *callee_info = clone_info::get (e->callee); + if (symtab->dump_file) + { + fprintf (symtab->dump_file, + "updating call of %s -> %s: ", e->caller->dump_name (), + e->callee->dump_name ()); + print_gimple_stmt (symtab->dump_file, e->call_stmt, 0, dump_flags); + if (callee_info && callee_info->param_adjustments) + callee_info->param_adjustments->dump (symtab->dump_file); + } + /* When redirecting a callback edge, all we need to do is replace the original address with the address of the function we are redirecting to. */ @@ -1876,16 +1887,6 @@ cgraph_edge::redirect_call_stmt_to_callee (cgraph_edge *e, } } - clone_info *callee_info = clone_info::get (e->callee); - if (symtab->dump_file) - { - fprintf (symtab->dump_file, "updating call of %s -> %s: ", - e->caller->dump_name (), e->callee->dump_name ()); - print_gimple_stmt (symtab->dump_file, e->call_stmt, 0, dump_flags); - if (callee_info && callee_info->param_adjustments) - callee_info->param_adjustments->dump (symtab->dump_file); - } - if (ipa_param_adjustments *padjs = callee_info ? callee_info->param_adjustments : NULL) {
