diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2025-01-08 18:20:47 +0000 |
---|---|---|
committer | Richard Sandiford <richard.sandiford@arm.com> | 2025-01-08 18:20:47 +0000 |
commit | 0de5c20b72a738782e31acce771c6f2085e1014b (patch) | |
tree | 179aaeb591cfe52921ed29bf69d8541f6aebccb4 /gcc/gimplify.cc | |
parent | f79f5b87efc690abc3b8d1b0f927f9348157348b (diff) | |
download | gcc-0de5c20b72a738782e31acce771c6f2085e1014b.zip gcc-0de5c20b72a738782e31acce771c6f2085e1014b.tar.gz gcc-0de5c20b72a738782e31acce771c6f2085e1014b.tar.bz2 |
aarch64: Fix overly restrictive sibcall check [PR107102]
aarch64_function_ok_for_sibcall required the caller and callee
to use the same PCS variant. However, it should be enough for the
callee to preserve at least as much register state as the caller;
preserving more state is fine.
ARM_PCS_AAPCS64, ARM_PCS_SIMD, and ARM_PCS_SVE agree on what
GPRs should be preserved. For the others:
- ARM_PCS_AAPCS64 preserves D8-D15
- ARM_PCS_SIMD preserves Q8-Q23
- ARM_PCS_SVE preserves Z8-Z23 + P4-P15
Thus it's ok for something earlier in the list to tail call something
later in the list.
gcc/
PR target/107102
* config/aarch64/aarch64.cc (aarch64_function_ok_for_sibcall): Only
reject calls with different PCSes if the callee clobbers register
state that the caller must preserve.
gcc/testsuite/
PR target/107102
* gcc.target/aarch64/sve/sibcall_1.c: New test.
Diffstat (limited to 'gcc/gimplify.cc')
0 files changed, 0 insertions, 0 deletions