https://gcc.gnu.org/g:24b344c5a446214625cf5c6c4324d199f25dfcf4
commit r17-4982-g24b344c5a446214625cf5c6c4324d199f25dfcf4 Author: Aldy Hernandez <[email protected]> Date: Fri Oct 2 12:52:27 2026 +0000 path solver: move DEBUG_SOLVER to the header as DEBUG_PATH_RANGER MOve DEBUG_SOLVER to the header and rename it so it doesn't conflict with anything else. A later patch will add another use of DEBUG_PATH_RANGER. Tested on ppc64le Linux. gcc/ChangeLog: * gimple-range-path.cc (DEBUG_SOLVER): Move... (path_range_query::range_defined_in_block): Adjust. (path_range_query::compute_ranges_in_block): Likewise. (path_range_query::compute_ranges): Likewise. * gimple-range-path.h (DEBUG_PATH_RANGER): ...here, renamed. Diff: --- gcc/gimple-range-path.cc | 15 ++++++--------- gcc/gimple-range-path.h | 4 ++++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/gcc/gimple-range-path.cc b/gcc/gimple-range-path.cc index 1e9f2b0be6cb..167d57397a8b 100644 --- a/gcc/gimple-range-path.cc +++ b/gcc/gimple-range-path.cc @@ -33,9 +33,6 @@ along with GCC; see the file COPYING3. If not see #include "tree-cfg.h" #include "gimple-iterator.h" -// Internal construct to help facilitate debugging of solver. -#define DEBUG_SOLVER (dump_file && (param_threader_debug == THREADER_DEBUG_ALL)) - path_range_query::path_range_query (gimple_ranger &ranger, const vec<basic_block> &path, const bitmap_head *dependencies, @@ -327,7 +324,7 @@ path_range_query::range_defined_in_block (vrange &r, tree name, basic_block bb) if (bb && POINTER_TYPE_P (TREE_TYPE (name))) infer_oracle ().maybe_adjust_range (r, name, bb); - if (DEBUG_SOLVER && (bb || !r.varying_p ())) + if (DEBUG_PATH_RANGER && (bb || !r.varying_p ())) { fprintf (dump_file, "range_defined_in_block (BB%d) for ", bb ? bb->index : -1); print_generic_expr (dump_file, name, TDF_SLIM); @@ -419,7 +416,7 @@ path_range_query::compute_ranges_in_block (basic_block bb) if (m_resolve && relations_may_be_invalidated (e)) { - if (DEBUG_SOLVER) + if (DEBUG_PATH_RANGER) fprintf (dump_file, "Resetting relations as they may be invalidated in %d->%d.\n", e->src->index, e->dest->index); @@ -443,7 +440,7 @@ path_range_query::compute_ranges_in_block (basic_block bb) r.intersect (cached_range); m_cache.set_range (name, r); - if (DEBUG_SOLVER) + if (DEBUG_PATH_RANGER) { fprintf (dump_file, "edge_range_p for "); print_generic_expr (dump_file, name, TDF_SLIM); @@ -571,7 +568,7 @@ path_range_query::compute_exit_dependencies (bitmap dependencies) void path_range_query::compute_ranges (const bitmap_head *dependencies) { - if (DEBUG_SOLVER) + if (DEBUG_PATH_RANGER) fprintf (dump_file, "\n==============================================\n"); if (dependencies) @@ -603,7 +600,7 @@ path_range_query::compute_ranges (const bitmap_head *dependencies) } } - if (DEBUG_SOLVER) + if (DEBUG_PATH_RANGER) { fprintf (dump_file, "path_range_query: compute_ranges for path: "); for (unsigned i = m_path.length (); i > 0; --i) @@ -629,7 +626,7 @@ path_range_query::compute_ranges (const bitmap_head *dependencies) move_next (); } - if (DEBUG_SOLVER) + if (DEBUG_PATH_RANGER) { get_path_oracle ()->dump (dump_file); dump (dump_file); diff --git a/gcc/gimple-range-path.h b/gcc/gimple-range-path.h index b665b464f0d8..3e37eeb7175e 100644 --- a/gcc/gimple-range-path.h +++ b/gcc/gimple-range-path.h @@ -21,6 +21,10 @@ along with GCC; see the file COPYING3. If not see #ifndef GCC_TREE_SSA_THREADSOLVER_H #define GCC_TREE_SSA_THREADSOLVER_H +// Internal construct to help facilitate debugging of the path solver. +#define DEBUG_PATH_RANGER \ + (dump_file && (param_threader_debug == THREADER_DEBUG_ALL)) + // This class is a basic block path solver. Given a set of BBs // indicating a path through the CFG, range_of_expr and range_of_stmt // will calculate the range of an SSA or STMT as if the BBs in the
