On Wed, Aug 30, 2023 at 03:25:11PM -0700, Andrew Pinski via Gcc-patches wrote: > This simple patch extends the min_value/max_value match to vector integer > types. > Using uniform_integer_cst_p makes this easy.
These tests FAIL on i686-linux, with .../gcc/testsuite/gcc.dg/pr110915-1.c:8:1: warning: MMX vector return without MMX enabled changes the ABI [-Wpsabi] .../gcc/testsuite/gcc.dg/pr110915-1.c:7:15: warning: MMX vector argument without MMX enabled changes the ABI [-Wpsabi] excess warnings. I've added -Wno-psabi to quiet that up, plus I think it is undesirable to define macros like vector before including C library headers in case the header would use that identifier in non-obfuscated form somewhere. Tested on x86_64-linux with make check-gcc RUNTESTFLAGS='--target_board=unix\{-m32,-m32/-march=i686,-m64\} dg.exp=pr110915*' which previously FAILed, committed to trunk as obvious. 2023-09-01 Jakub Jelinek <ja...@redhat.com> PR tree-optimization/110915 * gcc.dg/pr110915-1.c: Add -Wno-psabi to dg-options. Move vector macro definition after limits.h inclusion. * gcc.dg/pr110915-2.c: Likewise. * gcc.dg/pr110915-3.c: Likewise. * gcc.dg/pr110915-4.c: Likewise. * gcc.dg/pr110915-5.c: Likewise. * gcc.dg/pr110915-6.c: Likewise. * gcc.dg/pr110915-7.c: Likewise. * gcc.dg/pr110915-8.c: Likewise. * gcc.dg/pr110915-9.c: Likewise. * gcc.dg/pr110915-10.c: Likewise. * gcc.dg/pr110915-11.c: Likewise. * gcc.dg/pr110915-12.c: Likewise. --- gcc/testsuite/gcc.dg/pr110915-1.c.jj 2023-08-31 19:52:16.889305069 +0200 +++ gcc/testsuite/gcc.dg/pr110915-1.c 2023-09-01 14:12:47.937873487 +0200 @@ -1,9 +1,10 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-ifcombine" } */ -#define vector __attribute__((vector_size(sizeof(unsigned)*2))) +/* { dg-options "-O2 -fdump-tree-ifcombine -Wno-psabi" } */ #include <limits.h> +#define vector __attribute__((vector_size(sizeof(unsigned)*2))) + vector signed and1(vector unsigned x, vector unsigned y) { /* (x > y) & (x != 0) --> x > y */ --- gcc/testsuite/gcc.dg/pr110915-2.c.jj 2023-08-31 19:52:16.889305069 +0200 +++ gcc/testsuite/gcc.dg/pr110915-2.c 2023-09-01 14:12:52.791808013 +0200 @@ -1,9 +1,10 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-optimized" } */ -#define vector __attribute__((vector_size(sizeof(unsigned)*2))) +/* { dg-options "-O2 -fdump-tree-optimized -Wno-psabi" } */ #include <limits.h> +#define vector __attribute__((vector_size(sizeof(unsigned)*2))) + vector signed and1(vector unsigned x, vector unsigned y) { /* (x > y) & (x != 0) --> x > y */ --- gcc/testsuite/gcc.dg/pr110915-3.c.jj 2023-08-31 19:52:16.889305069 +0200 +++ gcc/testsuite/gcc.dg/pr110915-3.c 2023-09-01 14:12:57.514744307 +0200 @@ -1,9 +1,10 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-ifcombine" } */ -#define vector __attribute__((vector_size(sizeof(unsigned)*2))) +/* { dg-options "-O2 -fdump-tree-ifcombine -Wno-psabi" } */ #include <limits.h> +#define vector __attribute__((vector_size(sizeof(unsigned)*2))) + vector signed and1(vector unsigned x, vector unsigned y) { /* (x > y) & (x == 0) --> false */ --- gcc/testsuite/gcc.dg/pr110915-4.c.jj 2023-08-31 19:52:16.889305069 +0200 +++ gcc/testsuite/gcc.dg/pr110915-4.c 2023-09-01 14:13:02.094682529 +0200 @@ -1,9 +1,10 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-optimized" } */ -#define vector __attribute__((vector_size(sizeof(unsigned)*2))) +/* { dg-options "-O2 -fdump-tree-optimized -Wno-psabi" } */ #include <limits.h> +#define vector __attribute__((vector_size(sizeof(unsigned)*2))) + vector signed and1(vector unsigned x, vector unsigned y) { /* (x > y) & (x == 0) --> false */ --- gcc/testsuite/gcc.dg/pr110915-5.c.jj 2023-08-31 19:52:16.889305069 +0200 +++ gcc/testsuite/gcc.dg/pr110915-5.c 2023-09-01 14:13:06.609621628 +0200 @@ -1,9 +1,10 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-ifcombine" } */ -#define vector __attribute__((vector_size(sizeof(unsigned)*2))) +/* { dg-options "-O2 -fdump-tree-ifcombine -Wno-psabi" } */ #include <limits.h> +#define vector __attribute__((vector_size(sizeof(unsigned)*2))) + vector signed and1(vector unsigned x, vector unsigned y) { /* (x <= y) & (x == 0) --> x == 0 */ --- gcc/testsuite/gcc.dg/pr110915-6.c.jj 2023-08-31 19:52:16.889305069 +0200 +++ gcc/testsuite/gcc.dg/pr110915-6.c 2023-09-01 14:13:11.175560039 +0200 @@ -1,9 +1,10 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-optimized" } */ -#define vector __attribute__((vector_size(sizeof(unsigned)*2))) +/* { dg-options "-O2 -fdump-tree-optimized -Wno-psabi" } */ #include <limits.h> +#define vector __attribute__((vector_size(sizeof(unsigned)*2))) + vector signed and1(vector unsigned x, vector unsigned y) { /* (x <= y) & (x == 0) --> x == 0 */ --- gcc/testsuite/gcc.dg/pr110915-7.c.jj 2023-08-31 19:52:16.889305069 +0200 +++ gcc/testsuite/gcc.dg/pr110915-7.c 2023-09-01 14:13:15.838497142 +0200 @@ -1,9 +1,10 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-ifcombine" } */ -#define vector __attribute__((vector_size(sizeof(unsigned)*2))) +/* { dg-options "-O2 -fdump-tree-ifcombine -Wno-psabi" } */ #include <limits.h> +#define vector __attribute__((vector_size(sizeof(unsigned)*2))) + vector signed or1(vector unsigned x, vector unsigned y) { /* (x > y) | (x != 0) --> x != 0 */ --- gcc/testsuite/gcc.dg/pr110915-8.c.jj 2023-08-31 19:52:16.889305069 +0200 +++ gcc/testsuite/gcc.dg/pr110915-8.c 2023-09-01 14:13:20.579433193 +0200 @@ -1,9 +1,10 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-optimized" } */ -#define vector __attribute__((vector_size(sizeof(unsigned)*2))) +/* { dg-options "-O2 -fdump-tree-optimized -Wno-psabi" } */ #include <limits.h> +#define vector __attribute__((vector_size(sizeof(unsigned)*2))) + vector signed or1(vector unsigned x, vector unsigned y) { /* (x > y) | (x != 0) --> x != 0 */ --- gcc/testsuite/gcc.dg/pr110915-9.c.jj 2023-08-31 19:52:16.889305069 +0200 +++ gcc/testsuite/gcc.dg/pr110915-9.c 2023-09-01 14:13:27.147344600 +0200 @@ -1,9 +1,10 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-ifcombine" } */ -#define vector __attribute__((vector_size(sizeof(unsigned)*2))) +/* { dg-options "-O2 -fdump-tree-ifcombine -Wno-psabi" } */ #include <limits.h> +#define vector __attribute__((vector_size(sizeof(unsigned)*2))) + vector signed or1(vector unsigned x, vector unsigned y) { /* (x <= y) | (x != 0) --> true */ --- gcc/testsuite/gcc.dg/pr110915-10.c.jj 2023-08-31 19:52:16.889305069 +0200 +++ gcc/testsuite/gcc.dg/pr110915-10.c 2023-09-01 14:12:30.660106543 +0200 @@ -1,9 +1,10 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-optimized" } */ -#define vector __attribute__((vector_size(sizeof(unsigned)*2))) +/* { dg-options "-O2 -fdump-tree-optimized -Wno-psabi" } */ #include <limits.h> +#define vector __attribute__((vector_size(sizeof(unsigned)*2))) + vector unsigned or1(vector unsigned x, vector unsigned y) { /* (x <= y) | (x != 0)) --> true */ --- gcc/testsuite/gcc.dg/pr110915-11.c.jj 2023-08-31 19:52:16.889305069 +0200 +++ gcc/testsuite/gcc.dg/pr110915-11.c 2023-09-01 14:12:36.510027635 +0200 @@ -1,9 +1,10 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-ifcombine" } */ -#define vector __attribute__((vector_size(sizeof(unsigned)*2))) +/* { dg-options "-O2 -fdump-tree-ifcombine -Wno-psabi" } */ #include <limits.h> +#define vector __attribute__((vector_size(sizeof(unsigned)*2))) + vector unsigned or1(vector unsigned x, vector unsigned y) { /* (x <= y) | (x == 0) --> x <= y */ --- gcc/testsuite/gcc.dg/pr110915-12.c.jj 2023-08-31 19:52:16.889305069 +0200 +++ gcc/testsuite/gcc.dg/pr110915-12.c 2023-09-01 14:12:41.322962714 +0200 @@ -1,9 +1,10 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-dce3" } */ -#define vector __attribute__((vector_size(sizeof(unsigned)*2))) +/* { dg-options "-O2 -fdump-tree-dce3 -Wno-psabi" } */ #include <limits.h> +#define vector __attribute__((vector_size(sizeof(unsigned)*2))) + vector unsigned or1(vector unsigned x, vector unsigned y) { /* (x <= y) | (x == 0) --> x <= y */ Jakub