public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Aldy Hernandez <aldyh@redhat.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: Rainer Orth <ro@cebitec.uni-bielefeld.de>,
	Jeff Law <law@redhat.com>, gcc-patches <gcc-patches@gcc.gnu.org>,
	Andrew MacLeod <amacleod@redhat.com>
Subject: Re: [patch] canonicalize unsigned [1,MAX] ranges into ~[0,0]
Date: Thu, 17 Oct 2019 07:17:00 -0000	[thread overview]
Message-ID: <09f33b53-e592-9bf9-b542-68100954f56f@redhat.com> (raw)
In-Reply-To: <20191016074607.GL2116@tucnak>

[-- Attachment #1: Type: text/plain, Size: 344 bytes --]

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?

[-- Attachment #2: curr.patch --]
[-- Type: text/x-patch, Size: 1055 bytes --]

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	other threads:[~2019-10-17  7:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-04 12:59 Aldy Hernandez
2019-10-04 15:38 ` Jeff Law
2019-10-04 15:49   ` Aldy Hernandez
2019-10-04 16:02     ` Jeff Law
2019-10-04 16:14       ` Aldy Hernandez
2019-10-04 17:17         ` Jeff Law
2019-10-07 12:28           ` Aldy Hernandez
2019-10-13 16:32             ` Jeff Law
2019-10-15 11:59             ` Rainer Orth
2019-10-15 12:37               ` Aldy Hernandez
2019-10-15 12:45                 ` Rainer Orth
2019-10-15 13:07                   ` Iain Sandoe
2019-10-15 18:21                 ` Jakub Jelinek
2019-10-16  7:46                   ` Aldy Hernandez
2019-10-16  8:14                     ` Jakub Jelinek
2019-10-17  7:17                       ` Aldy Hernandez [this message]
2019-10-17  7:38                         ` Jakub Jelinek
2019-10-04 16:29   ` Richard Biener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=09f33b53-e592-9bf9-b542-68100954f56f@redhat.com \
    --to=aldyh@redhat.com \
    --cc=amacleod@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=law@redhat.com \
    --cc=ro@cebitec.uni-bielefeld.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).