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.