From: Aldy Hernandez <aldyh@redhat.com>
To: GCC patches <gcc-patches@gcc.gnu.org>
Cc: Jeff Law <jeffreyalaw@gmail.com>,
Andrew MacLeod <amacleod@redhat.com>,
Aldy Hernandez <aldyh@redhat.com>
Subject: [COMMITTED] Remove assert from set_nonzero_bits.
Date: Tue, 4 Oct 2022 19:52:21 +0200 [thread overview]
Message-ID: <20221004175221.1493497-1-aldyh@redhat.com> (raw)
The assert removed by this patch was there to keep users from passing
masks of incompatible types. The self tests are passing host wide
ints down (set_nonzero_bits (-1)), which seem to be 32 bits, whereas
some embedded targets have integer_type_node's of 16-bits. This is
causing problems in m32c-elf, among others.
I suppose there's no harm in passing a 32-bit mask, because
set_nonzero_bits calls wide_int::from() to convert the mask to the
appropriate type. So we can remove the assert.
Sorry for the pain Jeff.
gcc/ChangeLog:
* value-range.cc (irange::set_nonzero_bits): Remove assert.
---
gcc/value-range.cc | 1 -
1 file changed, 1 deletion(-)
diff --git a/gcc/value-range.cc b/gcc/value-range.cc
index afb26a40083..a307559b654 100644
--- a/gcc/value-range.cc
+++ b/gcc/value-range.cc
@@ -2913,7 +2913,6 @@ irange::set_nonzero_bits (const wide_int_ref &bits)
{
gcc_checking_assert (!undefined_p ());
unsigned prec = TYPE_PRECISION (type ());
- gcc_checking_assert (prec == bits.get_precision ());
// Drop VARYINGs with a nonzero mask to a plain range.
if (m_kind == VR_VARYING && bits != -1)
--
2.37.1
next reply other threads:[~2022-10-04 17:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-04 17:52 Aldy Hernandez [this message]
2022-10-04 18:45 ` Jeff Law
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=20221004175221.1493497-1-aldyh@redhat.com \
--to=aldyh@redhat.com \
--cc=amacleod@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jeffreyalaw@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).