rs6000: Enable more sibcalls when TOC is not preserved
authorBill Schmidt <wschmidt@linux.ibm.com>
Wed, 19 Aug 2020 18:43:55 +0000 (13:43 -0500)
committerBill Schmidt <wschmidt@linux.ibm.com>
Wed, 19 Aug 2020 18:43:55 +0000 (13:43 -0500)
commit95f17e26112d8a0700e8a9912e2f4f48a24ba1ea
tree9dffad1e20d30777b80466f59b169c066ced05ed
parent5abc821556e141c9b7003877d09d9dd9e9f98ae7
rs6000: Enable more sibcalls when TOC is not preserved

A function compiled with the PC-relative addressing model does not
require r2 to contain a TOC pointer, and does not guarantee that r2
will be preserved for its caller.  Such a function can make sibcalls
without restriction based on TOC preservation rules.  However, a
caller that does preserve r2 cannot make a sibcall to a callee that
does not.

2020-08-19  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/
* config/rs6000/rs6000-logue.c (rs6000_decl_ok_for_sibcall):
Sibcalls are always legal when the caller doesn't preserve r2.

gcc/testsuite/
* gcc.target/powerpc/pcrel-sibcall-1.c: Adjust.
gcc/config/rs6000/rs6000-logue.c
gcc/testsuite/gcc.target/powerpc/pcrel-sibcall-1.c