An empty CONSTRUCTOR of an SVE or RVV tuple type is not stored at all at
expand time, so svfloat32x4_t x = {} or *p = (svfloat32x4_t) {} leaves the
registers or memory unchanged. Patch 2 passes the poly size to
store_constructor. Patch 1 lets the aarch64 predicate-tuple move take a
zero, which patch 2 would otherwise turn from wrong code into an LRA ICE
for svboolx2_t/svboolx4_t.
Bootstrapped and regression tested on x86_64-pc-linux-gnu. On
aarch64-linux-gnu (qemu), regression tested dg.exp, aarch64.exp and the
SVE tests at SVE VL128, and the SVE tests at VL2048. On riscv64,
compiling gcc.target/riscv/rvv/base changes the asm of the new test only.
Tested together with the PR123370 patch.
OK for trunk?
Dominic P (2):
aarch64: Allow zero to be moved into an SVE predicate tuple [PR121105]
expr: Clear an empty constructor of a poly-sized type [PR121105]
gcc/config/aarch64/aarch64-sve.md | 1 +
gcc/expr.cc | 5 +-
.../g++.target/aarch64/sve/pr121105.C | 13 ++
.../gcc.target/aarch64/sve/pr121105_1.c | 121 ++++++++++++++++++
.../gcc.target/aarch64/sve/pr121105_2.c | 33 +++++
.../gcc.target/riscv/rvv/base/pr121105.c | 21 +++
6 files changed, 193 insertions(+), 1 deletion(-)
create mode 100644 gcc/testsuite/g++.target/aarch64/sve/pr121105.C
create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/pr121105_1.c
create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/pr121105_2.c
create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/pr121105.c
--
2.56.0