]> git.ipfire.org Git - thirdparty/gcc.git/commit
rs6000: Handle pcrel sibcalls to longcall functions [PR104894]
authorPeter Bergner <bergner@linux.ibm.com>
Mon, 11 Apr 2022 22:00:44 +0000 (17:00 -0500)
committerPeter Bergner <bergner@linux.ibm.com>
Mon, 11 Apr 2022 22:01:25 +0000 (17:01 -0500)
commitd74c4c6a1b4956b5cd9b2a770bb7261836fa1289
treef1fbfa0ae400258d99cfb9ea5aabbc5a5484a08a
parent3a5e662590c46277549cd3ee1d367983bde7d19e
rs6000: Handle pcrel sibcalls to longcall functions [PR104894]

Before PCREL in POWER10, we were not allowed to perform sibcalls to longcall
functions since callee's return would skip the TOC restore in the caller.
However, with PCREL we can now safely perform a sibling call to longcall
functions.  The problem with the current code is that pcrel sibcall
branches to a PLT stub label even though -fno-plt was used.  The solution
here is to check for a pcrel longcall and emit an inline plt stub in
that case.

2022-04-11  Peter Bergner  <bergner@linux.ibm.com>

gcc/
PR target/104894
* config/rs6000/rs6000.cc (rs6000_sibcall_aix): Handle pcrel sibcalls
to longcall functions.

gcc/testsuite/
PR target/104894
* gcc.target/powerpc/pr104894.c: New test.
* gcc.target/powerpc/pr104894-2.c: New test.
gcc/config/rs6000/rs6000.cc
gcc/testsuite/gcc.target/powerpc/pr104894-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/pr104894.c [new file with mode: 0644]