On 1/13/25 3:15 AM, Jin Ma wrote:
When the vsetvl instructions of the two RVV instructions are merged
using "use_max_sew", it is possible to update the sew of prev if
prev.sew < next.sew, but keep the original ratio, which is obviously
wrong. when the subsequent instructions are equal to the wrong ratio,
it is possible to generate the wrong "vsetvli zero,zero" instruction,
which will lead to unknown avl.

gcc/ChangeLog:

        * config/riscv/riscv-vsetvl.cc:

gcc/testsuite/ChangeLog:

        * gcc.target/riscv/rvv/base/bug-10.c: New test.
ChangeLog missing for the riscv-vsetvl.cc change.  I'll fix that.


diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/bug-10.c 
b/gcc/testsuite/gcc.target/riscv/rvv/base/bug-10.c
new file mode 100644
index 000000000000..c1a8ac95c17f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/bug-10.c
@@ -0,0 +1,15 @@
+/* { dg-do compile { target { rv64 } } } */
+/* { dg-skip-if "" { *-*-* } { "-O0" "-O1" "-O3" "-Og" "-Os" "-Oz" } } */
+/* { dg-options " -march=rv64gcv_zvfh -mabi=lp64d -O2 --param=vsetvl-strategy=optim 
-fno-schedule-insns  -fno-schedule-insns2 -fno-schedule-fusion " } */
So as written this test will be totally skipped (and I've verified that locally). It looks like you just wanted -O2 and we're not cycling through options, so we don't need/want the dg-skip-if. I'll fix that too.


I'll make the obvious changes and push the result to the trunk.

Thanks,
jeff

Reply via email to