From b223a28db4e098ef2005daaac6c669912f249d97 Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Thu, 17 Oct 2019 12:38:38 +0000 Subject: [PATCH] re PR tree-optimization/92131 (incorrect assumption that (ao >= 0) is always false) PR tree-optimization/92131 * tree-vrp.c (value_range_base::dump): Display +INF for both pointers and integers when appropriate. From-SVN: r277107 --- gcc/ChangeLog | 6 ++++++ gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.dg/tree-ssa/evrp4.c | 2 +- gcc/tree-vrp.c | 4 ++-- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9c0e754360e..3126adc95f4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-10-17 Aldy Hernandez + + PR tree-optimization/92131 + * tree-vrp.c (value_range_base::dump): Display +INF for both + pointers and integers when appropriate. + 2019-10-17 Andre Vieira * tree-vect-loop.c (vect_analyze_loop_2): Use same condition to decide diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 39496169bc5..abd9dd1c2dd 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2019-10-17 Aldy Hernandez + + * gcc.dg/tree-ssa/evrp4.c: Check for +INF instead of -1. + 2019-10-17 Christophe Lyon * gcc.target/arm/vseleqdf.c: Add missing closing bracket. 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 -- 2.30.2