aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAndrew Pinski <quic_apinski@quicinc.com>2025-03-17 11:28:16 -0700
committerAndrew Pinski <quic_apinski@quicinc.com>2025-03-18 07:45:48 -0700
commitcfbabe10ddaba3f200f58910d49aa041d2abde8c (patch)
tree17297fe704116e1d5cc2498a76295329604de637 /gcc
parent453d42046c461a8aa8ed68a88b94dac2d4dde73b (diff)
downloadgcc-cfbabe10ddaba3f200f58910d49aa041d2abde8c.zip
gcc-cfbabe10ddaba3f200f58910d49aa041d2abde8c.tar.gz
gcc-cfbabe10ddaba3f200f58910d49aa041d2abde8c.tar.bz2
SCC-Copy: Add More Debug dumps
While debugging a failure, I noticed that SCC copy didn't print out what it was doing, e.g. replacing name1 with name 2. This adds that dump. Bootstrapped and tested on x86_64-linux-gnu. gcc/ChangeLog: * gimple-ssa-sccopy.cc (scc_copy_prop::replace_scc_by_value): Dump what is being replaced with what. Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/gimple-ssa-sccopy.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/gimple-ssa-sccopy.cc b/gcc/gimple-ssa-sccopy.cc
index 7ffb571..298feb0 100644
--- a/gcc/gimple-ssa-sccopy.cc
+++ b/gcc/gimple-ssa-sccopy.cc
@@ -38,6 +38,7 @@ along with GCC; see the file COPYING3. If not see
#include "builtins.h"
#include "tree-ssa-dce.h"
#include "fold-const.h"
+#include "tree-pretty-print.h"
/* Strongly connected copy propagation pass.
@@ -485,6 +486,15 @@ scc_copy_prop::replace_scc_by_value (vec<gimple *> scc, tree val)
for (gimple *stmt : scc)
{
tree name = gimple_get_lhs (stmt);
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "Replacing ");
+ print_generic_expr (dump_file, name);
+ fprintf (dump_file, " with ");
+ print_generic_expr (dump_file, val);
+ fprintf (dump_file, "\n");
+
+ }
replace_uses_by (name, val);
bitmap_set_bit (dead_stmts, SSA_NAME_VERSION (name));
}