On Tue, Aug 25, 2026 at 5:30 PM <[email protected]> wrote:
>
> From: Kyrylo Tkachov <[email protected]>
>
> vec-mask-zero-1.c uses 128-bit V4SI and V4UI types and checks their
> final optimized GIMPLE.  The vect_int effective target is true on
> SPARC, but SPARC supports only 64-bit vector modes.  Vector lowering
> therefore splits the operations and changes the expected dump counts.
>
> Require vect128 in addition to vect_int.  This keeps the final-form
> checks on targets that support the tested vector size.
>
> Tested with a sparc64-linux-gnu cross compiler under both -m32 and
> -m64.  The test is unsupported in both configurations.  The test
> passes on aarch64-unknown-linux-gnu.
>
> Pushing to trunk.

This is because the foldings do not happen for generic not target supported
vectors, right?  But vect128 doesn't guarantee the comparisons or the
bit operations work.

Also the vector effective targets do not work outside of vect.exp ...

So I fear the testcase is still broken (more so now).

For some of the foldings we accept not supported results if (all of) the
source operations are not supported.  This works as guard to after
lowering as all operations are supported then.  It still leaves the hole
(as existing supportability checks) for offloading where pre-offload
all such target support checks are not applicable to the offload target
(so in principle we'd need to defer all these foldings until after bytecode
streaming, iff offload is in effect).

Richard.

> gcc/testsuite/ChangeLog:
>
>         PR tree-optimization/127069
>         * gcc.dg/tree-ssa/vec-mask-zero-1.c: Also require vect128.
>
> Signed-off-by: Kyrylo Tkachov <[email protected]>
> ---
>  gcc/testsuite/gcc.dg/tree-ssa/vec-mask-zero-1.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vec-mask-zero-1.c 
> b/gcc/testsuite/gcc.dg/tree-ssa/vec-mask-zero-1.c
> index 8e1a20a764e..835c23fc06d 100644
> --- a/gcc/testsuite/gcc.dg/tree-ssa/vec-mask-zero-1.c
> +++ b/gcc/testsuite/gcc.dg/tree-ssa/vec-mask-zero-1.c
> @@ -1,4 +1,4 @@
> -/* { dg-do compile { target vect_int } } */
> +/* { dg-do compile { target { vect_int && vect128 } } } */
>  /* { dg-options "-O2 -fdump-tree-optimized -Wno-psabi" } */
>  /* { dg-additional-options "-msse2" { target ia32 } } */
>  /* Combine pairs of vector comparisons against zero or all-ones.  Use
> --
> 2.50.1 (Apple Git-155)
>

Reply via email to