rs6000.c (rs6000_call_template_1): Handle pcrel calls here...
authorBill Schmidt <wschmidt@linux.ibm.com>
Wed, 29 May 2019 21:50:09 +0000 (21:50 +0000)
committerWilliam Schmidt <wschmidt@gcc.gnu.org>
Wed, 29 May 2019 21:50:09 +0000 (21:50 +0000)
commite800d6dc2cb329a1b64bb3af136164910778a40c
treea01860addae26089649bb9282df8abd616887b77
parent874f88c43bc504d49228f53365d2fd565077ecdd
rs6000.c (rs6000_call_template_1): Handle pcrel calls here...

[gcc]

2019-05-29  Bill Schmidt  <wschmidt@linux.ibm.com>
    Alan Modra  <amodra@gmail.com>

* config/rs6000/rs6000.c (rs6000_call_template_1): Handle pcrel
calls here...
(rs6000_indirect_call_template_1): ...and here.
(rs6000_pltseq_template): Handle plt_pcrel34.  Rework tocsave,
plt16_ha, plt16_lo, mtctr indirect calls.  Use
rs6000_pltseq_enum.
(rs6000_decl_ok_for_sibcall): New function.
(rs6000_function_ok_for_sibcall): Refactor.
(rs6000_longcall_ref): Use UNSPEC_PLT_PCREL when pcrel.
(rs6000_call_aix): Don't emit toc restore rtl for indirect calls
when pcrel.  Reorganize.
(rs6000_sibcall_aix): Don't add r2 to function usage when pcrel.
* rs6000.h (rs6000_pltseq_enum): New enum.
* rs6000.md (UNSPEC_PLT_PCREL): New unspec.
(*pltseq_tocsave): Use rs6000_pltseq_enum.
(*pltseq_plt16_ha): Likewise.
(*pltseq_plt16_lo): Likewise.
(*pltseq_mtctr): Likewise.
(*pltseq_plt_pcrel): New insn.
(*call_local_aix): Handle @notoc calls.
(*call_value_local_aix): Likewise.
(*call_nonlocal_aix): Adjust lengths for pcrel calls.
(*call_value_nonlocal_aix): Likewise.
(*call_indirect_pcrel): New insn.
(*call_value_indirect_pcrel): Likewise.

[gcc/testsuite]

2019-05-29  Bill Schmidt  <wschmidt@linux.ibm.com>

* gcc.target/powerpc/notoc-direct-1.c: New.
* gcc.target/powerpc/pcrel-sibcall-1.c: New.

Co-Authored-By: Alan Modra <amodra@gmail.com>
From-SVN: r271753
gcc/ChangeLog
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/rs6000.h
gcc/config/rs6000/rs6000.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/notoc-direct-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/pcrel-sibcall-1.c [new file with mode: 0644]