public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Kito Cheng <kito@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r11-9700] [PR/target 102957] Allow Z*-ext extension with only 2 char.
Date: Mon, 28 Mar 2022 06:43:17 +0000 (GMT)	[thread overview]
Message-ID: <20220328064317.132643858C56@sourceware.org> (raw)

https://gcc.gnu.org/g:40e9979cf531e6a1ca1db8804c80e40e0e71de4c

commit r11-9700-g40e9979cf531e6a1ca1db8804c80e40e0e71de4c
Author: Kito Cheng <kito.cheng@sifive.com>
Date:   Mon Nov 8 22:45:49 2021 +0800

    [PR/target 102957] Allow Z*-ext extension with only 2 char.
    
    We was assume the Z* extension should be more than 2 char, so we put an
    assertion there, but it should just an error or warning rather than an
    assertion, however RISC-V has add `Zk` extension, which just 2 char, so
    actually, we should just allow that.
    
    gcc/ChangeLog
    
            PR target/102957
            * common/config/riscv/riscv-common.c (multi_letter_subset_rank): Remove
            assertion for Z*-ext.
    
    gcc/testsuite/ChangeLog
    
            * gcc.target/riscv/pr102957.c: New.
    
    (cherry picked from commit abe562bb01479ea2c8952ad98714f3225527aa7e)

Diff:
---
 gcc/common/config/riscv/riscv-common.c    | 1 -
 gcc/testsuite/gcc.target/riscv/pr102957.c | 5 +++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/gcc/common/config/riscv/riscv-common.c b/gcc/common/config/riscv/riscv-common.c
index 34b74e52a2d..807c3a3c119 100644
--- a/gcc/common/config/riscv/riscv-common.c
+++ b/gcc/common/config/riscv/riscv-common.c
@@ -197,7 +197,6 @@ multi_letter_subset_rank (const std::string &subset)
       high_order = 1;
       break;
     case 'z':
-      gcc_assert (subset.length () > 2);
       high_order = 2;
       break;
     case 'x':
diff --git a/gcc/testsuite/gcc.target/riscv/pr102957.c b/gcc/testsuite/gcc.target/riscv/pr102957.c
new file mode 100644
index 00000000000..8a7e541bf6d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/pr102957.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-O -march=rv64gzb -mabi=lp64" } */
+int foo()
+{
+}


                 reply	other threads:[~2022-03-28  6:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220328064317.132643858C56@sourceware.org \
    --to=kito@gcc.gnu.org \
    --cc=gcc-cvs@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).