From: Aldy Hernandez <aldyh@redhat.com>
To: GCC patches <gcc-patches@gcc.gnu.org>
Cc: Andrew MacLeod <amacleod@redhat.com>, Aldy Hernandez <aldyh@redhat.com>
Subject: [COMMITTED] Remove irange::may_contain_p.
Date: Wed, 26 Apr 2023 10:33:25 +0200 [thread overview]
Message-ID: <20230426083328.313566-6-aldyh@redhat.com> (raw)
In-Reply-To: <20230426083328.313566-1-aldyh@redhat.com>
The deprecated irange::may_contain_p method differed from contains_p
in that it could handle symbolics, which no longer exist in VRP.
gcc/ChangeLog:
* value-range.cc (irange::may_contain_p): Remove.
* value-range.h (range_includes_zero_p): Rewrite may_contain_p
usage with contains_p.
* vr-values.cc (compare_range_with_value): Same.
---
gcc/value-range.cc | 8 --------
gcc/value-range.h | 4 ++--
gcc/vr-values.cc | 3 ++-
3 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/gcc/value-range.cc b/gcc/value-range.cc
index 26acba7b04b..6c61bcefd6e 100644
--- a/gcc/value-range.cc
+++ b/gcc/value-range.cc
@@ -1475,14 +1475,6 @@ irange::value_inside_range (tree val) const
return !!cmp2;
}
-/* Return TRUE if it is possible that range contains VAL. */
-
-bool
-irange::may_contain_p (tree val) const
-{
- return value_inside_range (val) != 0;
-}
-
/* Return TRUE if range contains INTEGER_CST. */
/* Return 1 if VAL is inside value range.
0 if VAL is not inside value range.
diff --git a/gcc/value-range.h b/gcc/value-range.h
index d2a275958c8..929dc551aa2 100644
--- a/gcc/value-range.h
+++ b/gcc/value-range.h
@@ -173,7 +173,6 @@ public:
bool constant_p () const; // DEPRECATED
void normalize_symbolics (); // DEPRECATED
void normalize_addresses (); // DEPRECATED
- bool may_contain_p (tree) const; // DEPRECATED
bool legacy_verbose_union_ (const class irange *); // DEPRECATED
bool legacy_verbose_intersect (const irange *); // DEPRECATED
@@ -828,7 +827,8 @@ range_includes_zero_p (const irange *vr)
if (vr->varying_p ())
return true;
- return vr->may_contain_p (build_zero_cst (vr->type ()));
+ tree zero = build_zero_cst (vr->type ());
+ return vr->contains_p (zero);
}
extern void gt_ggc_mx (vrange *);
diff --git a/gcc/vr-values.cc b/gcc/vr-values.cc
index ea4fbd7af67..841bcd1acb9 100644
--- a/gcc/vr-values.cc
+++ b/gcc/vr-values.cc
@@ -375,7 +375,8 @@ compare_range_with_value (enum tree_code comp, const value_range *vr,
return NULL_TREE;
/* ~[VAL_1, VAL_2] OP VAL is known if VAL_1 <= VAL <= VAL_2. */
- if (!vr->may_contain_p (val))
+ bool contains_p = TREE_CODE (val) != INTEGER_CST || vr->contains_p (val);
+ if (!contains_p)
return (comp == NE_EXPR) ? boolean_true_node : boolean_false_node;
return NULL_TREE;
--
2.40.0
next prev parent reply other threads:[~2023-04-26 8:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-26 8:33 [COMMITTED] Remove compare_names* from legacy cond folding Aldy Hernandez
2023-04-26 8:33 ` [COMMITTED] Refactor vrp_evaluate_conditional* and rename it Aldy Hernandez
2023-04-26 8:33 ` [COMMITTED] Remove range_query::get_value_range Aldy Hernandez
2023-04-26 8:33 ` [COMMITTED] Remove deprecated range_fold_{unary,binary}_expr uses from ipa-* Aldy Hernandez
2023-05-05 15:10 ` [COMMITTED] Remove deprecated range_fold_{unary, binary}_expr " Martin Jambor
2023-05-11 9:58 ` Aldy Hernandez
2023-05-15 17:33 ` Aldy Hernandez
2023-04-26 8:33 ` [COMMITTED] Remove range_fold_{unary,binary}_expr Aldy Hernandez
2023-04-26 8:33 ` Aldy Hernandez [this message]
2023-04-26 8:33 ` [COMMITTED] Remove symbolics from irange Aldy Hernandez
2023-04-26 8:33 ` [COMMITTED] Remove irange::constant_p Aldy Hernandez
2023-04-26 8:33 ` [COMMITTED] Convert users of legacy API to get_legacy_range() function 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=20230426083328.313566-6-aldyh@redhat.com \
--to=aldyh@redhat.com \
--cc=amacleod@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
/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).