On 10/16/19 3:46 AM, Jakub Jelinek wrote:
On Wed, Oct 16, 2019 at 03:38:38AM -0400, Aldy Hernandez wrote:
Would you take care of this, or shall I?

Will defer to you, I have quite a lot of stuff on my plate ATM.

        Jakub


No problem.  Thanks for your analysis though.

The attached patch fixes the regression.

OK pending tests?
gcc/

	PR tree-optimization/92131
	* tree-vrp.c (value_range_base::dump): Display +INF for both
	pointers and integers when appropriate.

gcc/testsuite/

	* gcc.dg/tree-ssa/evrp4.c: Check for +INF instead of -1.

diff --git a/gcc/testsuite/gcc.dg/tree-ssa/evrp4.c b/gcc/testsuite/gcc.dg/tree-ssa/evrp4.c
index ba2f6b9b430..6710e6b5eff 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/evrp4.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/evrp4.c
@@ -17,4 +17,4 @@ int bar (struct st *s)
   foo (&s->a);
 }
 
-/* { dg-final { scan-tree-dump "\\\[1B, -1B\\\]" "evrp" } } */
+/* { dg-final { scan-tree-dump "\\\[1B, \\+INF\\\]" "evrp" } } */
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 21910b36518..8d4f16e9e1f 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -428,8 +428,8 @@ value_range_base::dump (FILE *file) const
 
       fprintf (file, ", ");
 
-      if (INTEGRAL_TYPE_P (ttype)
-	  && vrp_val_is_max (max ())
+      if (supports_type_p (ttype)
+	  && vrp_val_is_max (max (), true)
 	  && TYPE_PRECISION (ttype) != 1)
 	fprintf (file, "+INF");
       else

Reply via email to