On Fri, 8 Nov 2019 at 10:44, Richard Sandiford <richard.sandif...@arm.com> wrote: > > Tested on aarch64-linux-gnu and x86_64-linux-gnu. Applied as obvious. >
Hi Richard, The new deref_2.c test fails with -mabi=ilp32: FAIL: gcc.target/aarch64/sve/acle/general/deref_2.c -march=armv8.2-a+sve (test for excess errors) Excess errors: /gcc/testsuite/gcc.target/aarch64/sve/acle/general/deref_2.c:17:39: error: no matching function for call to 'svld1(svbool_t&, int32_t*&)' /gcc/testsuite/gcc.target/aarch64/sve/acle/general/deref_2.c:17:38: error: invalid conversion from 'int32_t*' {aka 'long int*'} to 'const int*' [-fpermissive] /gcc/testsuite/gcc.target/aarch64/sve/acle/general/deref_2.c:17:38: error: invalid conversion from 'int32_t*' {aka 'long int*'} to 'const unsigned int*' [-fpermissive] /gcc/testsuite/gcc.target/aarch64/sve/acle/general/deref_2.c:18:43: error: no matching function for call to 'svld1(svbool_t&, int32_t*&)' /gcc/testsuite/gcc.target/aarch64/sve/acle/general/deref_2.c:18:42: error: invalid conversion from 'int32_t*' {aka 'long int*'} to 'const int*' [-fpermissive] /gcc/testsuite/gcc.target/aarch64/sve/acle/general/deref_2.c:18:42: error: invalid conversion from 'int32_t*' {aka 'long int*'} to 'const unsigned int*' [-fpermissive] Christophe > Richard > > > 2019-11-08 Richard Sandiford <richard.sandif...@arm.com> > > gcc/ > * tree-ssa-sccvn.c (copy_reference_ops_from_ref): Handle > POLY_INT_CST. > > gcc/testsuite/ > * gcc.target/aarch64/sve/acle/general/deref_2.c: New test. > * gcc.target/aarch64/sve/acle/general/whilele_8.c: Likewise. > * gcc.target/aarch64/sve/acle/general/whilelt_4.c: Likewise. > > Index: gcc/tree-ssa-sccvn.c > =================================================================== > --- gcc/tree-ssa-sccvn.c 2019-10-31 17:15:21.594544316 +0000 > +++ gcc/tree-ssa-sccvn.c 2019-11-08 09:43:07.927488162 +0000 > @@ -928,6 +928,7 @@ copy_reference_ops_from_ref (tree ref, v > break; > case STRING_CST: > case INTEGER_CST: > + case POLY_INT_CST: > case COMPLEX_CST: > case VECTOR_CST: > case REAL_CST: > Index: gcc/testsuite/gcc.target/aarch64/sve/acle/general/deref_2.c > =================================================================== > --- /dev/null 2019-09-17 11:41:18.176664108 +0100 > +++ gcc/testsuite/gcc.target/aarch64/sve/acle/general/deref_2.c 2019-11-08 > 09:43:07.927488162 +0000 > @@ -0,0 +1,20 @@ > +/* { dg-options "-O2" } */ > + > +#include <arm_sve.h> > +#include <string.h> > + > +inline void > +copy (void *dst, svbool_t src) > +{ > + memcpy (dst, &src, svcntd ()); > +} > + > +uint64_t > +f (int32_t *x, int32_t *y) > +{ > + union { uint64_t x; char c[8]; } u; > + svbool_t pg = svptrue_b32 (); > + copy (u.c, svcmpeq (pg, svld1 (pg, x), 0)); > + copy (u.c + 4, svcmpeq (pg, svld1 (pg, y), 1)); > + return u.x; > +} > Index: gcc/testsuite/gcc.target/aarch64/sve/acle/general/whilele_8.c > =================================================================== > --- /dev/null 2019-09-17 11:41:18.176664108 +0100 > +++ gcc/testsuite/gcc.target/aarch64/sve/acle/general/whilele_8.c > 2019-11-08 09:43:07.927488162 +0000 > @@ -0,0 +1,33 @@ > +/* { dg-do compile } */ > +/* { dg-options "-O2" } */ > + > +#include <arm_sve.h> > + > +/* { dg-final { scan-assembler-not {\tptrue\t} } } */ > +/* { dg-final { scan-assembler-not {\tpfalse\t} } } */ > + > +void > +test1 (svbool_t *ptr) > +{ > + *ptr = svwhilele_b32_s32 (-4, 0); > +} > + > +void > +test2 (svbool_t *ptr) > +{ > + *ptr = svwhilele_b16_s64 (svcntb (), svcntb () + 8); > +} > + > +void > +test3 (svbool_t *ptr) > +{ > + *ptr = svwhilele_b64_s32 (0, 2); > +} > + > +void > +test4 (svbool_t *ptr) > +{ > + *ptr = svwhilele_b8_s64 (16, svcntb ()); > +} > + > +/* { dg-final { scan-assembler-times {\twhilel[et]\t} 4 } } */ > Index: gcc/testsuite/gcc.target/aarch64/sve/acle/general/whilelt_4.c > =================================================================== > --- /dev/null 2019-09-17 11:41:18.176664108 +0100 > +++ gcc/testsuite/gcc.target/aarch64/sve/acle/general/whilelt_4.c > 2019-11-08 09:43:07.927488162 +0000 > @@ -0,0 +1,33 @@ > +/* { dg-do compile } */ > +/* { dg-options "-O2" } */ > + > +#include <arm_sve.h> > + > +/* { dg-final { scan-assembler-not {\tptrue\t} } } */ > +/* { dg-final { scan-assembler-not {\tpfalse\t} } } */ > + > +void > +test1 (svbool_t *ptr) > +{ > + *ptr = svwhilelt_b32_s32 (-4, 1); > +} > + > +void > +test2 (svbool_t *ptr) > +{ > + *ptr = svwhilelt_b16_s64 (svcntb (), svcntb () + 9); > +} > + > +void > +test3 (svbool_t *ptr) > +{ > + *ptr = svwhilelt_b64_s32 (0, 3); > +} > + > +void > +test4 (svbool_t *ptr) > +{ > + *ptr = svwhilelt_b8_s64 (16, svcntb ()); > +} > + > +/* { dg-final { scan-assembler-times {\twhilel[et]\t} 4 } } */