From c055929ff2de906b7706428d42152b1a51cb3b0a Mon Sep 17 00:00:00 2001 From: Feng Xue Date: Tue, 3 Mar 2020 10:32:40 +0800 Subject: [PATCH] Fix dump in clone materialization 2020-06-01 Feng Xue gcc/ * cgraphclones.c (materialize_all_clones): Adjust replace map dump. * ipa-param-manipulation.c (ipa_dump_adjusted_parameters): Do not dump infomation if there is no adjusted parameter. * (ipa_param_adjustments::dump): Adjust prefix spaces for dump string. --- gcc/cgraphclones.c | 6 +++--- gcc/ipa-param-manipulation.c | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/gcc/cgraphclones.c b/gcc/cgraphclones.c index e4f1c1d4b5e..db61c218297 100644 --- a/gcc/cgraphclones.c +++ b/gcc/cgraphclones.c @@ -1160,15 +1160,15 @@ symbol_table::materialize_all_clones (void) if (node->clone.tree_map) { unsigned int i; - fprintf (symtab->dump_file, " replace map: "); + fprintf (symtab->dump_file, " replace map:"); for (i = 0; i < vec_safe_length (node->clone.tree_map); i++) { ipa_replace_map *replace_info; replace_info = (*node->clone.tree_map)[i]; - fprintf (symtab->dump_file, "%i -> ", - (*node->clone.tree_map)[i]->parm_num); + fprintf (symtab->dump_file, "%s %i -> ", + i ? "," : "", replace_info->parm_num); print_generic_expr (symtab->dump_file, replace_info->new_tree); } diff --git a/gcc/ipa-param-manipulation.c b/gcc/ipa-param-manipulation.c index 978916057f0..2cc4bc79dc1 100644 --- a/gcc/ipa-param-manipulation.c +++ b/gcc/ipa-param-manipulation.c @@ -111,6 +111,9 @@ ipa_dump_adjusted_parameters (FILE *f, unsigned i, len = vec_safe_length (adj_params); bool first = true; + if (!len) + return; + fprintf (f, " IPA adjusted parameters: "); for (i = 0; i < len; i++) { @@ -899,7 +902,7 @@ ipa_param_adjustments::dump (FILE *f) fprintf (f, " m_always_copy_start: %i\n", m_always_copy_start); ipa_dump_adjusted_parameters (f, m_adj_params); if (m_skip_return) - fprintf (f, " Will SKIP return.\n"); + fprintf (f, " Will SKIP return.\n"); } /* Dump information contained in the object in textual form to stderr. */ -- 2.30.2