On Feb 6, 2026, Jeffrey Law <[email protected]> wrote:
> The fact that there are so many damn extensions means that real
> coverage is virtually impossible.
*nod*
> BUt you're also clearly doing something different in your testing
Yeah, maybe the difference is that we're (also) testing riscv32-elf
builds. That's where the problems came up.
Unfortunately, it looks like riscv32-elf is not equivalent to
riscv64-elf with an explicit -march=*32*: I guess the -mcpu in the tests
overrides the base arch in the former case, but not in the latter.
If that theory is correct, I guess we should use explicit arch and abi
options to not leave this to chance, but maybe the arch (and abi)
options below need tuning for the tests to exercise the intended
features. riscv-cores.def has monster arch lines for these cpus, and
I'm hesitant to just copy those.
Or we could just add -march=unset to let the compiler apply the default
arch for the cpu. That would cancel out the explicit -march=*32* you're
testing with, and refrain from testing these two cases in 32-bit mode.
I'm not sure how important that would be. Also, I don't recall by heart
whether options added in "multilib" testing are added before or after
test-given options to be sure it would actually fix it; we don't do much
of that kind of testing. Something to check after I catch some sleep...
If these lines of thought make sense to you and you'd rather beat me to
fixing these, please be my guest ;-) But please let me know, otherwise
I'll end up looking into it tomorrow. Err, today.
Anyhow, sorry about the breakage.
diff --git a/gcc/testsuite/gcc.target/riscv/pr114139.c
b/gcc/testsuite/gcc.target/riscv/pr114139.c
index 5aa587f1b6f0f..0c1b5cef22fd2 100644
--- a/gcc/testsuite/gcc.target/riscv/pr114139.c
+++ b/gcc/testsuite/gcc.target/riscv/pr114139.c
@@ -1,5 +1,7 @@
/* { dg-do compile { target { ! riscv_abi_e } } } */
-/* { dg-options "-O2 -fpic -mexplicit-relocs -mcpu=sifive-p450 -mabi=lp64d" }
*/
+/* { dg-additional-options "-march=rv64gc -mabi=lp64d" { target { rv64 } } } */
+/* { dg-additional-options "-march=rv32gc -mabi=ilp32" { target { rv32 } } } */
+/* { dg-options "-O2 -fpic -mexplicit-relocs -mcpu=sifive-p450" } */
static void *p;
extern void *a[];
diff --git a/gcc/testsuite/gcc.target/riscv/pr118170.c
b/gcc/testsuite/gcc.target/riscv/pr118170.c
index a39c4170ff2f5..7dcb7e25de092 100644
--- a/gcc/testsuite/gcc.target/riscv/pr118170.c
+++ b/gcc/testsuite/gcc.target/riscv/pr118170.c
@@ -1,5 +1,7 @@
/* { dg-do "compile" { target { ! riscv_abi_e } } } */
-/* { dg-options "-O2 -mcpu=tt-ascalon-d8 -mabi=lp64d" } */
+/* { dg-additional-options "-march=rv64gc -mabi=lp64d" { target { rv64 } } } */
+/* { dg-additional-options "-march=rv32gc -mabi=ilp32" { target { rv32 } } } */
+/* { dg-options "-O2 -mcpu=tt-ascalon-d8" } */
_Float16 f;
void
--
Alexandre Oliva, happy hacker https://blog.lx.oliva.nom.br/
Free Software Activist FSFLA co-founder GNU Toolchain Engineer
More tolerance and less prejudice are key for inclusion and diversity.
Excluding neuro-others for not behaving ""normal"" is *not* inclusive!