[RS6000] Put call cookie back in AIX/ELFv2 call patterns
-mlongcall -mno-pltseq is supposed to emit long calls by using
indirect calls. It differs from -mlongcall -mpltseq in that the
function addresses are not placed in the PLT and thus lazy PLT
resolution is not available, affecting programs that dlopen shared
libraries.
In the case of -mcpu=future -mpcrel -mlongcall -mno-pltseq we see an
indirect call being generated, but combine merrily optimises the
sequence back to a direct call. call_indirect_pcrel is enough like
call_nonlocal_aix that this can happen.
This patch puts the call cookie back in the call rtl, removed by git
commit
f90f960ca8, in order to disable the optimisation for long
calls. When that is done for call_local_aix the pattern becomes the
same as call_local32/64, so I merged them. The only difference
besides mode between call_local32 and call_local64, dating back to
1998 commit
a260abc996, is that call_local64 has TARGET_64BIT in the
predicate. That alone doesn't seem reason enough to need separate
patterns; The P mode iterator selects DI on TARGET_64BIT anyway.
* config/rs6000/rs6000.c (rs6000_call_aix): Emit cookie to pattern.
(rs6000_indirect_call_template_1): Adjust to suit.
* config/rs6000/rs6000.md (call_local): Merge call_local32,
call_local64, and call_local_aix.
(call_value_local): Simlarly.
(call_nonlocal_aix, call_value_nonlocal_aix): Adjust rtl to suit,
and disable pattern when CALL_LONG.
(call_indirect_aix, call_value_indirect_aix): Adjust rtl.
(call_indirect_elfv2, call_indirect_pcrel): Likewise.
(call_value_indirect_elfv2, call_value_indirect_pcrel): Likewise.