Hi Christophe,

On 2025-07-11 15:47, Christophe Lyon wrote:
Hi Torbjörn,

On Fri, 11 Jul 2025 at 10:47, Torbjörn SVENSSON
<torbjorn.svens...@foss.st.com> 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.

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.


So IIUC:
- on gcc-14 the tests are skipped because you override -march/-mcpu
when testing, and arm_v8_neon_ok fails when called from
vect_early_break ?

Not quite. On gcc-14 (running with -march=armv7ve/-mcpu=cortex-a7), the tests are considered, but they are built with the wrong flags so they XPASS.

- on gcc-15 and trunk, the tests now pass thanks to -mcpu=unset/-march=unset
but you are concerned that 'dg-add-options vect_early_break' is used
without the corresponding effective-target?

As the arm_v8_neon (part of vect_early_break check) results in `-mfpu=neon-fp-armv8 -mcpu=unset -march=armv8-a` flags, the test is PASS instead.

So your patch is just "cosmetic" and has no impact on the testsuite results?

For gcc-15 and trunk, it's consmetic for now, but may change in the future depending on the use/implementation of vect_early_break_hw etc.

I have another concern (hence cc'ing Alexandre): vect.exp calls
check_vect_support_and_set_flags which defines dg-do-what-default
according to what it discovers, meaning that for some targets these
tests are 'run' and on others they are just 'compile'.
So I suppose we should use 'dg-require-effective-target
vect_early_break_hw' only when running the tests and
'dg-require-effective-target vect_early_break' when compiling them?

I suppose at the moment we completely skip these tests, while would
could at least compile them on some targets?

I guess we would skip it too, but I can't find `vect_early_break_hw` in the log for gcc-14 where the test is XPASS, so I'm not sure this is completly true. I'm also a bit confused about the selector used for the dg-final statement. I think it would make more sense to simply drop the condition and always expect it to be PASS and only run the test on supported targets.

I think you can remove the 'arm' keywork in the title of your commit
message, as this patch can impact all targets.

Ok, I will make sure to do that prior to pushing or a v2.

Kind regards,
Torbjörn

Thanks,

Christophe



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 } */

--
2.25.1


Reply via email to