RISC-V: Fix riscv/arch-19.c with different ISA spec version

Message ID orcysrpytx.fsf@lxoliva.fsfla.org
State Committed
Delegated to: Kito Cheng
Headers
Series RISC-V: Fix riscv/arch-19.c with different ISA spec version |

Checks

Context Check Description
rivoscibot/toolchain-ci-rivos-apply-patch success Patch applied
rivoscibot/toolchain-ci-rivos-lint success Lint passed
rivoscibot/toolchain-ci-rivos-build--newlib-rv64gcv-lp64d-multilib success Build passed
rivoscibot/toolchain-ci-rivos-build--linux-rv64gcv-lp64d-multilib success Build passed
rivoscibot/toolchain-ci-rivos-build--newlib-rv64gc-lp64d-multilib success Build passed
rivoscibot/toolchain-ci-rivos-build--linux-rv64gc_zba_zbb_zbc_zbs-lp64d-non-multilib success Build passed
rivoscibot/toolchain-ci-rivos-build--linux-rv32gc_zba_zbb_zbc_zbs-ilp32d-non-multilib success Build passed
rivoscibot/toolchain-ci-rivos-test success Testing passed
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 warning Patch is already merged
linaro-tcwg-bot/tcwg_gcc_build--master-arm warning Patch is already merged

Commit Message

Alexandre Oliva Feb. 20, 2024, 4:02 a.m. UTC
  This testcase is failing with riscv64-elf and riscv32-elf in the gcc-13
branch, if configured to use an assembler that supports -misa-spec; with
an assembler that doesn't, the test passes both with and without the
following backport from the trunk, so I'd like to install it in gcc-13.
Regstrapped on x86_64-linux-gnu, along with other backports, and tested
manually on riscv64-elf.  Ok to install?

From: Kito Cheng <kito.cheng@sifive.com>

In newer ISA spec, F will implied zicsr, add that into -march option to
prevent different test result on different default -misa-spec version.

gcc/testsuite/

	* gcc.target/riscv/arch-19.c: Add -misa-spec.

(cherry picked from commit 9fde76a3be8e1717d9d38492c40675e742611e45)
---
 gcc/testsuite/gcc.target/riscv/arch-19.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Kito Cheng Feb. 20, 2024, 1:33 p.m. UTC | #1
LGTM :)

On Tue, Feb 20, 2024 at 12:03 PM Alexandre Oliva <oliva@adacore.com> wrote:
>
> This testcase is failing with riscv64-elf and riscv32-elf in the gcc-13
> branch, if configured to use an assembler that supports -misa-spec; with
> an assembler that doesn't, the test passes both with and without the
> following backport from the trunk, so I'd like to install it in gcc-13.
> Regstrapped on x86_64-linux-gnu, along with other backports, and tested
> manually on riscv64-elf.  Ok to install?
>
> From: Kito Cheng <kito.cheng@sifive.com>
>
> In newer ISA spec, F will implied zicsr, add that into -march option to
> prevent different test result on different default -misa-spec version.
>
> gcc/testsuite/
>
>         * gcc.target/riscv/arch-19.c: Add -misa-spec.
>
> (cherry picked from commit 9fde76a3be8e1717d9d38492c40675e742611e45)
> ---
>  gcc/testsuite/gcc.target/riscv/arch-19.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gcc/testsuite/gcc.target/riscv/arch-19.c b/gcc/testsuite/gcc.target/riscv/arch-19.c
> index b042e1a49fe6f..95204ede26a69 100644
> --- a/gcc/testsuite/gcc.target/riscv/arch-19.c
> +++ b/gcc/testsuite/gcc.target/riscv/arch-19.c
> @@ -1,4 +1,4 @@
>  /* { dg-do compile } */
> -/* { dg-options "-march=rv64if_zfinx -mabi=lp64" } */
> +/* { dg-options "-march=rv64if_zicsr_zfinx -mabi=lp64" } */
>  int foo() {}
> -/* { dg-error "'-march=rv64if_zfinx': z\\*inx conflicts with floating-point extensions" "" { target *-*-* } 0 } */
> +/* { dg-error "'-march=rv64if_zicsr_zfinx': z\\*inx conflicts with floating-point extensions" "" { target *-*-* } 0 } */
>
> --
> Alexandre Oliva, happy hacker            https://FSFLA.org/blogs/lxo/
>    Free Software Activist                   GNU Toolchain Engineer
> More tolerance and less prejudice are key for inclusion and diversity
> Excluding neuro-others for not behaving ""normal"" is *not* inclusive
  

Patch

diff --git a/gcc/testsuite/gcc.target/riscv/arch-19.c b/gcc/testsuite/gcc.target/riscv/arch-19.c
index b042e1a49fe6f..95204ede26a69 100644
--- a/gcc/testsuite/gcc.target/riscv/arch-19.c
+++ b/gcc/testsuite/gcc.target/riscv/arch-19.c
@@ -1,4 +1,4 @@ 
 /* { dg-do compile } */
-/* { dg-options "-march=rv64if_zfinx -mabi=lp64" } */
+/* { dg-options "-march=rv64if_zicsr_zfinx -mabi=lp64" } */
 int foo() {}
-/* { dg-error "'-march=rv64if_zfinx': z\\*inx conflicts with floating-point extensions" "" { target *-*-* } 0 } */
+/* { dg-error "'-march=rv64if_zicsr_zfinx': z\\*inx conflicts with floating-point extensions" "" { target *-*-* } 0 } */