Hi,

On Mon, Sep 21 2026, Josef Melcr wrote:
> 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.

This is OK.

Thanks,

Martin


>
> Signed-off-by: Josef Melcr <[email protected]>
> ---
>  gcc/cgraph.cc | 21 +++++++++++----------
>  1 file changed, 11 insertions(+), 10 deletions(-)
>
> diff --git a/gcc/cgraph.cc b/gcc/cgraph.cc
> index 63e66026293..184b741b1be 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)
>      {
> -- 
> 2.55.0

Reply via email to