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 range_has_numeric_bounds_p.
Date: Wed, 26 Apr 2023 13:47:51 +0200 [thread overview]
Message-ID: <20230426114752.336928-6-aldyh@redhat.com> (raw)
In-Reply-To: <20230426114752.336928-1-aldyh@redhat.com>
gcc/ChangeLog:
* value-range.cc (irange::copy_legacy_to_multi_range): Rewrite use
of range_has_numeric_bounds_p with irange API.
(range_has_numeric_bounds_p): Delete.
* value-range.h (range_has_numeric_bounds_p): Delete.
---
gcc/value-range.cc | 12 +++---------
gcc/value-range.h | 1 -
2 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/gcc/value-range.cc b/gcc/value-range.cc
index da9098139ad..f7c3e7a00e2 100644
--- a/gcc/value-range.cc
+++ b/gcc/value-range.cc
@@ -979,7 +979,9 @@ irange::copy_legacy_to_multi_range (const irange &src)
set_varying (src.type ());
else
{
- if (range_has_numeric_bounds_p (&src))
+ if (!src.undefined_p ()
+ && TREE_CODE (src.min ()) == INTEGER_CST
+ && TREE_CODE (src.max ()) == INTEGER_CST)
set (src.min (), src.max (), src.kind ());
else
{
@@ -3068,14 +3070,6 @@ ranges_from_anti_range (const value_range *ar,
return !vr0->undefined_p ();
}
-bool
-range_has_numeric_bounds_p (const irange *vr)
-{
- return (!vr->undefined_p ()
- && TREE_CODE (vr->min ()) == INTEGER_CST
- && TREE_CODE (vr->max ()) == INTEGER_CST);
-}
-
/* Return whether VAL is equal to the maximum value of its type.
We can't do a simple equality comparison with TYPE_MAX_VALUE because
C typedefs and Ada subtypes can produce types whose TYPE_MAX_VALUE
diff --git a/gcc/value-range.h b/gcc/value-range.h
index c1474a73eaf..b47540d49be 100644
--- a/gcc/value-range.h
+++ b/gcc/value-range.h
@@ -669,7 +669,6 @@ irange::legacy_mode_p () const
return m_max_ranges == 1;
}
-extern bool range_has_numeric_bounds_p (const irange *);
extern bool ranges_from_anti_range (const value_range *,
value_range *, value_range *);
extern value_range_kind get_legacy_range (const irange &, tree &min, tree &max);
--
2.40.0
next prev parent reply other threads:[~2023-04-26 11:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-26 11:47 [COMMITTED] Fix swapping of ranges Aldy Hernandez
2023-04-26 11:47 ` [COMMITTED] Replace ad-hoc value_range dumpers with irange::dump Aldy Hernandez
2023-04-26 11:47 ` [COMMITTED] Remove some uses of deprecated irange API Aldy Hernandez
2023-04-26 11:47 ` [COMMITTED] Convert compare_nonzero_chars to wide_ints Aldy Hernandez
2023-04-26 11:47 ` [COMMITTED] Remove range_int_cst_p Aldy Hernandez
2023-04-26 11:47 ` Aldy Hernandez [this message]
2023-04-26 11:47 ` [COMMITTED] Remove legacy range support 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=20230426114752.336928-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).