From: Kito Cheng Date: Mon, 8 Nov 2021 14:45:49 +0000 (+0800) Subject: [PR/target 102957] Allow Z*-ext extension with only 2 char. X-Git-Tag: upstream/12.2.0~3635 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=abe562bb01479ea2c8952ad98714f3225527aa7e;p=platform%2Fupstream%2Fgcc.git [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 --git a/gcc/common/config/riscv/riscv-common.c b/gcc/common/config/riscv/riscv-common.c index 37b6ea8..f3c120b 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 0000000..8a7e541 --- /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() +{ +}