From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2093) id F3CF0385801D; Tue, 9 Nov 2021 16:26:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F3CF0385801D MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Kito Cheng To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-5062] [PR/target 102957] Allow Z*-ext extension with only 2 char. X-Act-Checkin: gcc X-Git-Author: Kito Cheng X-Git-Refname: refs/heads/master X-Git-Oldrev: 00c9ce13a64e324dabd8dfd236882919a3119479 X-Git-Newrev: abe562bb01479ea2c8952ad98714f3225527aa7e Message-Id: <20211109162614.F3CF0385801D@sourceware.org> Date: Tue, 9 Nov 2021 16:26:14 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2021 16:26:15 -0000 https://gcc.gnu.org/g:abe562bb01479ea2c8952ad98714f3225527aa7e commit r12-5062-gabe562bb01479ea2c8952ad98714f3225527aa7e Author: Kito Cheng 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. 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 37b6ea80086..f3c120b4cb4 100644 --- a/gcc/common/config/riscv/riscv-common.c +++ b/gcc/common/config/riscv/riscv-common.c @@ -202,7 +202,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() +{ +}