From: Aldy Hernandez <aldyh@redhat.com>
To: GCC patches <gcc-patches@gcc.gnu.org>
Subject: [PATCH] Fix selftest for targets where short and int are the same size.
Date: Tue, 25 May 2021 08:44:05 +0200 [thread overview]
Message-ID: <20210525064405.1347426-1-aldyh@redhat.com> (raw)
avr-elf seems to use HImode for both integer_type_node and
signed_char_type_node, which is causing the check for different sized
VARYING ranges to fail.
I've fixed this by using a char which I think should always be smaller than an
int. Is there a preferred way of fixing this? Perhaps build_nonstandard_integer
or __attribute__((mode(XX)))?
Tested on an x86-64 x avr-elf.
gcc/ChangeLog:
* value-range.cc (range_tests_legacy): Use signed char instead
of signed short.
---
gcc/value-range.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/value-range.cc b/gcc/value-range.cc
index 8d7b46c0239..5eefd5ff174 100644
--- a/gcc/value-range.cc
+++ b/gcc/value-range.cc
@@ -2251,10 +2251,10 @@ range_tests_legacy ()
// VARYING of different sizes should not be equal.
int_range_max r0 (integer_type_node);
- int_range_max r1 (short_integer_type_node);
+ int_range_max r1 (signed_char_type_node);
ASSERT_TRUE (r0 != r1);
value_range vr0 (integer_type_node);
- int_range_max vr1 (short_integer_type_node);
+ int_range_max vr1 (signed_char_type_node);
ASSERT_TRUE (vr0 != vr1);
}
--
2.31.1
next reply other threads:[~2021-05-25 6:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-25 6:44 Aldy Hernandez [this message]
2021-05-25 13:15 ` Jeff Law
2021-05-25 16:36 ` Aldy Hernandez
2021-05-25 17:10 ` 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=20210525064405.1347426-1-aldyh@redhat.com \
--to=aldyh@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).