On 11/07/2025 09:46, Torbjörn SVENSSON wrote:
Ok for trunk, gcc-15 and gcc-14.

I discovered that the dg-require-effective-target is missing on gcc-14,
but it's probably the right thing to add on gcc-15 and trunk too.

Without the `dg-require-effective-target vect_early_break`, the
`dg-add-options vect_early_break` will return the flags unchanged and
`dg-require-effective-target vect_early_break_hw` will succeed as it
overrides the flags, causing the tests to use the wrong target.

vect_early_break_hw must work as meaning that we have vect_early_break in the compiler and have the libraries and hardware to run the resulting code. So I think the problem lies with vect_early_break_hw. The two functions have to agree on the flags that are needed, so the _hw function needs to be implemented using code that matches the non-hw variant.

Usually that means that the _hw version starts by checking vect_early_break and then adding additional tests (for the hw) on top of that.

R.


Let me know what you think.

--

With the -mcpu=unset/-march=unset feature introduced in
r15-3606-g7d6c6a0d15c, these tests start to pass due to that the
cpu/arch is overridden. The proper thing to do when using
`dg-add-options vect_early_break` is to also have a
`dg-require-effective-target vect_early_break`, so adding this.

gcc/testsuite/ChangeLog:

        * gcc.dg/vect/tsvc/vect-tsvc-s332.c: Add
        dg-require-effective-target vect_early_break to test.
        * gcc.dg/vect/tsvc/vect-tsvc-s481.c: Likewise.
        * gcc.dg/vect/tsvc/vect-tsvc-s482.c: Likewise.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svens...@foss.st.com>
---
  gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s332.c | 1 +
  gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s481.c | 1 +
  gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s482.c | 1 +
  3 files changed, 3 insertions(+)

diff --git a/gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s332.c 
b/gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s332.c
index 21a9c5a6b2b..b4154040d1b 100644
--- a/gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s332.c
+++ b/gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s332.c
@@ -3,6 +3,7 @@
/* { dg-additional-options "--param vect-epilogues-nomask=0" } */
  /* { dg-require-effective-target vect_float } */
+/* { dg-require-effective-target vect_early_break } */
  /* { dg-require-effective-target vect_early_break_hw } *>   /* { 
dg-add-options vect_early_break } */
diff --git a/gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s481.c b/gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s481.c
index e4433385d66..156e44972bd 100644
--- a/gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s481.c
+++ b/gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s481.c
@@ -3,6 +3,7 @@
/* { dg-additional-options "--param vect-epilogues-nomask=0" } */
  /* { dg-require-effective-target vect_float } */
+/* { dg-require-effective-target vect_early_break } */
  /* { dg-require-effective-target vect_early_break_hw } */
  /* { dg-add-options vect_early_break } */
diff --git a/gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s482.c b/gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s482.c
index 146df409ecc..a1fcb18c557 100644
--- a/gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s482.c
+++ b/gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s482.c
@@ -3,6 +3,7 @@
/* { dg-additional-options "--param vect-epilogues-nomask=0" } */
  /* { dg-require-effective-target vect_float } */
+/* { dg-require-effective-target vect_early_break } */
  /* { dg-require-effective-target vect_early_break_hw } */
  /* { dg-add-options vect_early_break } */

Reply via email to