public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-9700] [PR/target 102957] Allow Z*-ext extension with only 2 char.
@ 2022-03-28  6:43 Kito Cheng
  0 siblings, 0 replies; only message in thread
From: Kito Cheng @ 2022-03-28  6:43 UTC (permalink / raw)
  To: gcc-cvs

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()
+{
+}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-03-28  6:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-28  6:43 [gcc r11-9700] [PR/target 102957] Allow Z*-ext extension with only 2 char Kito Cheng

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).