From: Aldy Hernandez <aldyh@redhat.com>
To: Jeff Law <law@redhat.com>, Richard Biener <richard.guenther@gmail.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>,
Andrew MacLeod <amacleod@redhat.com>
Subject: Re: [range-ops] patch 02/04: enforce canonicalization in value_range
Date: Wed, 03 Jul 2019 09:35:00 -0000 [thread overview]
Message-ID: <6d9cc6d8-47ea-8d8b-5f61-f1bd9bf2f362@redhat.com> (raw)
In-Reply-To: <d6271861-fc62-98c4-e7e8-984066393fb6@redhat.com>
On 7/2/19 5:36 PM, Jeff Law wrote:
> I don't see anything inherently concerning here. I do wonder if there's
> any value in having a debugging function in the class that would iterate
> over the ranges and check them for proper canonicalization, verify that
> VR_{VARYING,UNDEFINED} objects do not have equivalences, etc. Thoughts?
In patch 01 we have:
> diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
> index 594ee9adc17..97046c22ed1 100644
> --- a/gcc/tree-vrp.c
> +++ b/gcc/tree-vrp.c
> @@ -86,6 +86,8 @@ value_range_base::set (enum value_range_kind kind, tree min, t
> ree max)
> void
> value_range::set_equiv (bitmap equiv)
> {
> + if (undefined_p () || varying_p ())
> + equiv = NULL;
So it shouldn't be possible to attach an equivalence to a VARYING /
UNDEFINED range. Plus, we already have a sanity checker:
> void
> value_range::check ()
> {
> value_range_base::check ();
> switch (m_kind)
> {
> case VR_UNDEFINED:
> case VR_VARYING:
> gcc_assert (!m_equiv || bitmap_empty_p (m_equiv));
> default:;
> }
> }
We have no methods for altering a range, except for changing
equivalences. So it shouldn't be possible to create a non-canonicalized
range.
Aldy
next prev parent reply other threads:[~2019-07-03 9:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-01 9:02 Aldy Hernandez
2019-07-02 21:36 ` Jeff Law
2019-07-03 9:35 ` Aldy Hernandez [this message]
2019-07-03 23:09 ` Jeff Law
2019-07-17 8:15 ` Aldy Hernandez
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=6d9cc6d8-47ea-8d8b-5f61-f1bd9bf2f362@redhat.com \
--to=aldyh@redhat.com \
--cc=amacleod@redhat.com \
--cc=gcc-patches@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).