On Wed, Sep 16, 2026 at 1:38 PM Dominic P <[email protected]> wrote:
>
> 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 } */
You can't use the vect_* outside of the vect.exp testsuite part.
> /* { dg-options "-O2 -Wno-psabi -fdump-tree-forwprop1-raw" } */
Since you are testing forwprop1 which is correct but the problem is
the min/max formation in the first part dependent on
target_supports_op_p in match.pd .
>
> /* 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)));
Maybe it is better to use V1int or V256int. Note use sizeof here
instead of hard coded values.
Also you can replace 31 with (sizeof(int)*8-1) for better portability
and remove the int32 check.
>
> --
> 2.55.0
>