[COMMITTED] Range-on-edge trace tweak.

Message ID ff36f9c6-8c7c-344d-ea20-7503c0b042db@redhat.com
State Committed
Series [COMMITTED] Range-on-edge trace tweak. |

Commit Message

Andrew MacLeod Nov. 24, 2021, 2:06 p.m. UTC
  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.



From a031bb7a585f789df2aed856a57646b8c45d0878 Mon Sep 17 00:00:00 2001
From: Andrew MacLeod <amacleod@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);
       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.