The test scans forwprop1 for vector MIN_EXPR and MAX_EXPR, which a
target without vector support never forms: it lowers the operations
before forwprop1 runs.  Reported by Linaro CI on arm-eabi cortex-m0
soft.  Its three siblings already require vect_int.

Assisted-by: Claude Opus 5 (Anthropic)

gcc/testsuite/ChangeLog:

        * gcc.dg/tree-ssa/minmax-swar-5.c: Require vect_int.

Signed-off-by: Dominic P <[email protected]>
---
 gcc/testsuite/gcc.dg/tree-ssa/minmax-swar-5.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/tree-ssa/minmax-swar-5.c 
b/gcc/testsuite/gcc.dg/tree-ssa/minmax-swar-5.c
index 931d5a0d741..b6bec1eb18c 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/minmax-swar-5.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/minmax-swar-5.c
@@ -1,12 +1,13 @@
 /* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
 /* { dg-options "-O2 -Wno-psabi -fdump-tree-forwprop1-raw" } */
 
 /* All six rules on a vector type.  The selects against zero are spelled with
    >, not <: a vector x < 0 is canonicalised to the sign mask x >> 31, and the
    rule that turns x & (x >> 31) into MIN <x, 0> is scalar, so that spelling
    forms no vector MIN_EXPR at all.  The scan is on forwprop1, which runs
-   before the vector lowering that would split a MAX_EXPR the target cannot
-   do.  */
+   before the vector lowering that splits what the target cannot do; a
+   target with no vector support at all lowers earlier, hence vect_int.  */
 
 typedef int v4si __attribute__ ((vector_size (16)));
 
-- 
2.55.0

Reply via email to