From: Eric Botcazou <ebotcazou@adacore.com>
To: Richard Biener <richard.guenther@gmail.com>
Cc: gcc@gcc.gnu.org, Andrew MacLeod <amacleod@redhat.com>,
Jeff Law <law@redhat.com>, Aldy Hernandez <aldyh@redhat.com>
Subject: Re: On-Demand range technology [3/5] - The Prototype
Date: Thu, 23 May 2019 22:27:00 -0000 [thread overview]
Message-ID: <2670117.BxkPGqjVAe@polaris> (raw)
In-Reply-To: <CAFiYyc04DXYqa+Gv-X6ZinpEFnnUk2od=N=2hD1KqTOX5uMOJw@mail.gmail.com>
> While I agree that symbolic ranges are a complication and that most
> cases it currently handles are not "value-range" things I do not agree
> with the idea that we can simply remove handling them and deal
> with the fallout in some later point in the future. Eric may also be
> able to show you "real" symbolic value-range magic.
There are a couple of testcases in the testsuite that, I believe, require a
minimal form of support for symbolic ranges: gcc.dg/tree-ssa/vrp94.c and
gnat.dg/opt40.adb. They deal with the following pattern in C:
if (x >= y)
return 1;
z = y - x;
if (z <= 0)
abort ();
return z;
where we want to eliminate the abort. Of course the C version doesn't really
make sense on its own, but it's the translation of the Ada version where the
if (z <= 0)
abort ();
is generated by the compiler (it's a range check in Ada parlance).
I also agree that symbolic ranges are a complication but I don't understand
why they would conceptually be treated differently from literal ranges. Of
course things may been different practically speaking because I also agree
that they are of lesser importance than literal ranges in most cases.
> Note that symbolic ranges are already restricted to PLUS_EXPR
> and MINUS_EXPR (and NEGATE_EXPR I think). There are
> also "symbolic" (non-integer constant) ranges like [&a, &a].
Yes, the current implementation is restricted to additive operations.
--
Eric Botcazou
next prev parent reply other threads:[~2019-05-23 22:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-23 1:29 Andrew MacLeod
2019-05-23 13:10 ` Richard Biener
2019-05-23 22:27 ` Eric Botcazou [this message]
2019-05-24 8:03 ` Toon Moene
2019-05-24 9:36 ` Richard Biener
2019-05-24 15:52 ` Andrew MacLeod
2019-05-24 15:50 ` Andrew MacLeod
2019-05-28 14:41 ` Jeff Law
2019-05-28 18:06 ` Aldy Hernandez
2019-05-29 13:11 ` Richard Biener
2019-05-31 15:36 ` Andrew MacLeod
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=2670117.BxkPGqjVAe@polaris \
--to=ebotcazou@adacore.com \
--cc=aldyh@redhat.com \
--cc=amacleod@redhat.com \
--cc=gcc@gcc.gnu.org \
--cc=law@redhat.com \
--cc=richard.guenther@gmail.com \
/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).