From: Kyrylo Tkachov <[email protected]>
PR126405 is another wrong-code in the same category as PR123625 and PR121957.
An oversized vector (V16DI, 128 bytes, so no register mode) is spilled,
out-of-SSA leaves two of its partitions sharing one MEM_EXPR,
and the load/store pair-fusion pass,
which identifies a location by a MEM_EXPR base and an offset from it, fuses
two stores that are 144 bytes apart:
before (set (mem:V4SI [sp+240]) (reg v17)) ; g18_lsm.11+96
(set (mem:V4SI [sp+384]) (reg v27)) ; g18_lsm.11+112
after (set (mem:V2x16QI [sp+240])
(unspec [(reg v17) (reg v27)] UNSPEC_STP))
[sp+384] is then never written.
split_overlapping_partition_decls already exists to prevent this, from the fix
for PR123625 and PR121957. This series closes the two holes in
split_overlapping_partition_decls and then checks the invariant so that the
next one is an ICE rather than a miscompile.
Bootstrapped and tested on aarch64-none-linux-gnu and x86_64-pc-linux-gnu.
Kyrylo Tkachov (3):
out-of-SSA: Use all partition names to find the decl to split
[PR126405]
out-of-SSA: Split partitions of parameters and results too [PR126405]
cfgexpand: Verify that partitions do not share a MEM_EXPR [PR126405]
gcc/cfgexpand.cc | 38 +++++++++++--
gcc/cfgexpand.h | 1 +
.../gcc.c-torture/execute/pr126405-2.c | 54 ++++++++++++++++++
.../gcc.c-torture/execute/pr126405-3.c | 48 ++++++++++++++++
.../gcc.c-torture/execute/pr126405.c | 56 +++++++++++++++++++
gcc/testsuite/gcc.dg/pr126405-1.c | 29 ++++++++++
gcc/testsuite/gcc.dg/pr126405-2.c | 35 ++++++++++++
gcc/testsuite/gcc.dg/pr126405-3.c | 26 +++++++++
gcc/tree-outof-ssa.cc | 36 ++++++++++--
9 files changed, 314 insertions(+), 9 deletions(-)
create mode 100644 gcc/testsuite/gcc.c-torture/execute/pr126405-2.c
create mode 100644 gcc/testsuite/gcc.c-torture/execute/pr126405-3.c
create mode 100644 gcc/testsuite/gcc.c-torture/execute/pr126405.c
create mode 100644 gcc/testsuite/gcc.dg/pr126405-1.c
create mode 100644 gcc/testsuite/gcc.dg/pr126405-2.c
create mode 100644 gcc/testsuite/gcc.dg/pr126405-3.c
--
2.34.1