diff mbox series

Don't display ranges for dead ssa-names.

Message ID f45c2b59-bf34-e4d4-856f-f013280c1159@redhat.com
State New
Headers show
Series Don't display ranges for dead ssa-names. | expand

Commit Message

Andrew MacLeod Oct. 16, 2020, 7:14 p.m. UTC
AS Jakub  observed in an earlier testcase (97325),  when EVRP dumps the 
known SSA_RANGES, it isn't expecting names to be deleted that it could 
not delete, so it wasn't checking.

With the hybrid model, ranger sometimes deletes things that EVRP 
calculated a range for, and the resulting dump was confusing

  _1: short unsigned int VARYING
  _2: int [0, 65535]
  _3: int [-65535, 0]
  : int [0, 32]
  : long long unsigned int [0, 0]
  c_6(D): long long unsigned int VARYING
  : long long unsigned int [0, 32]

Now we just check if then name is valid before dumping.

Bootstrapped on x86_64-pc-linux-gnu,  no regressions, pushed.
diff mbox series

Patch

2020-10-16  Andrew MacLeod  <amacleod@redhat.com>

	* vr-values.c (dump_all_value_ranges): Only dump names which are
	still active.


diff --git a/gcc/vr-values.c b/gcc/vr-values.c
index da0b249278b..e917704d9bb 100644
--- a/gcc/vr-values.c
+++ b/gcc/vr-values.c
@@ -1999,7 +1999,7 @@  vr_values::dump_all_value_ranges (FILE *file)
 
   for (i = 0; i < num_vr_values; i++)
     {
-      if (vr_value[i])
+      if (vr_value[i] && ssa_name (i))
 	{
 	  print_generic_expr (file, ssa_name (i));
 	  fprintf (file, ": ");