When working with the trace output, I noticed the columns were getting
out of sync.
When range_on_edge is called with a constant value, it use to not output
a trace for that. When I added the unexecutable edge code, It possible
to request a constant on an unexecutable edge that now returns
UNDEFINED. The trace output prints the header, but returns for a
constant before outputting the trailer and realigning the columns.
Bootstrapped on x86_64-pc-linux-gnu with no regressions. Pushed as obvious.
Andrew
From a031bb7a585f789df2aed856a57646b8c45d0878 Mon Sep 17 00:00:00 2001
From: Andrew MacLeod <amacl...@redhat.com>
Date: Fri, 19 Nov 2021 13:27:18 -0500
Subject: [PATCH 1/4] Range-on-edge trace tweak.
Trace formatting gets out of sync when range on edge is called with a constant.
* gimple-range.cc (gimple_ranger::range_on_edge): Call trailer when
a constant is encountered to terminate the trace.
---
gcc/gimple-range.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/gimple-range.cc b/gcc/gimple-range.cc
index a2b68b2bc80..9ca568ce55d 100644
--- a/gcc/gimple-range.cc
+++ b/gcc/gimple-range.cc
@@ -216,7 +216,7 @@ gimple_ranger::range_on_edge (irange &r, edge e, tree name)
bool res = true;
if (!gimple_range_ssa_p (name))
- return get_tree_range (r, name, NULL);
+ res = get_tree_range (r, name, NULL);
else
{
range_on_exit (r, e->src, name);
@@ -230,7 +230,7 @@ gimple_ranger::range_on_edge (irange &r, edge e, tree name)
if (idx)
tracer.trailer (idx, "range_on_edge", res, name, r);
- return true;
+ return res;
}
// fold_range wrapper for range_of_stmt to use as an internal client.
--
2.17.2