aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-split.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2020-05-28 13:18:12 +0100
committerRichard Sandiford <richard.sandiford@arm.com>2020-05-28 13:18:12 +0100
commit1ccbfffb0fb614f09cf2b7b70f152d6e489cfd17 (patch)
tree9d3620397c9cb49d14f759fd69946001d2c90e2d /gcc/tree-ssa-loop-split.c
parent00cd57389767b9a81125f999d33d509cba0ebaaf (diff)
downloadgcc-1ccbfffb0fb614f09cf2b7b70f152d6e489cfd17.zip
gcc-1ccbfffb0fb614f09cf2b7b70f152d6e489cfd17.tar.gz
gcc-1ccbfffb0fb614f09cf2b7b70f152d6e489cfd17.tar.bz2
aarch64: Fix segfault in aarch64_expand_epilogue [PR95361]
The stack frame for the function in the testcase consisted of two SVE save slots. Both saves had been shrink-wrapped, but for different blocks, meaning that the stack allocation and deallocation were separate from the saves themselves. Before emitting the deallocation, we tried to attach a REG_CFA_DEF_CFA note to the preceding instruction, to redefine the CFA in terms of the stack pointer. But in this case there was no preceding instruction. This in practice only happens for SVE because: (a) We don't try to shrink-wrap wb_candidate* registers even when we've decided to treat them as normal saves and restores. I have a fix for that. (b) Even with (a) fixed, we're (almost?) guaranteed to emit a stack tie for frames that are 64k or larger, so we end up hanging the REG_CFA_DEF_CFA note on that instead. We should only need to redefine the CFA if it was previously defined in terms of the frame pointer. In other cases the CFA should already be defined in terms of the stack pointer, so redefining it is unnecessary but usually harmless. 2020-05-28 Richard Sandiford <richard.sandiford@arm.com> gcc/ PR testsuite/95361 * config/aarch64/aarch64.c (aarch64_expand_epilogue): Assert that we have at least some CFI operations when using a frame pointer. Only redefine the CFA if we have CFI operations. gcc/testsuite/ PR testsuite/95361 * gcc.target/aarch64/sve/pr95361.c: New test.
Diffstat (limited to 'gcc/tree-ssa-loop-split.c')
0 files changed, 0 insertions, 0 deletions