+2019-02-04 Alan Modra <amodra@gmail.com>
+
+ * config/rs6000/rs6000.c (rs6000_indirect_call_template_1),
+ (rs6000_pltseq_template): Guard output of TLS markers with
+ TARGET_TLS_MARKERS.
+ (rs6000_longcall_ref, rs6000_call_aix, rs6000_call_sysv),
+ (rs6000_sibcall_sysv): Ignore TARGET_TLS_MARKERS when deciding
+ to use inline PLT sequences.
+ * config/rs6000/rs6000.md (pltseq_tocsave_<mode>),
+ (pltseq_plt16_ha_<mode>, pltseq_plt16_lo_<mode>),
+ (pltseq_mtctr_<mode>): Don't test TARGET_TLS_MARKERS in predicate.
+
2019-02-04 Martin Liska <mliska@suse.cz>
PR ipa/88985
const char *rel64 = TARGET_64BIT ? "64" : "";
char tls[29];
tls[0] = 0;
- if (GET_CODE (operands[funop + 1]) == UNSPEC)
+ if (TARGET_TLS_MARKERS && GET_CODE (operands[funop + 1]) == UNSPEC)
{
if (XINT (operands[funop + 1], 1) == UNSPEC_TLSGD)
sprintf (tls, ".reloc .,R_PPC%s_TLSGD,%%%u\n\t",
const char *rel64 = TARGET_64BIT ? "64" : "";
char tls[28];
tls[0] = 0;
- if (GET_CODE (operands[3]) == UNSPEC)
+ if (TARGET_TLS_MARKERS && GET_CODE (operands[3]) == UNSPEC)
{
if (XINT (operands[3], 1) == UNSPEC_TLSGD)
sprintf (tls, ".reloc .,R_PPC%s_TLSGD,%%3\n\t",
}
if (HAVE_AS_PLTSEQ
- && TARGET_TLS_MARKERS
&& (DEFAULT_ABI == ABI_ELFv2 || DEFAULT_ABI == ABI_V4))
{
rtx base = const0_rtx;
stack_toc_offset));
MEM_VOLATILE_P (stack_toc_mem) = 1;
if (HAVE_AS_PLTSEQ
- && TARGET_TLS_MARKERS
&& DEFAULT_ABI == ABI_ELFv2
&& GET_CODE (func_desc) == SYMBOL_REF)
{
this insn for linker plt sequence editing too. */
func_addr = gen_rtx_REG (Pmode, CTR_REGNO);
if (HAVE_AS_PLTSEQ
- && TARGET_TLS_MARKERS
&& GET_CODE (func_desc) == SYMBOL_REF)
{
rtvec v = gen_rtvec (3, abi_reg, func_desc, tlsarg);
func = rs6000_longcall_ref (func_desc, tlsarg);
/* If the longcall was implemented using PLT16 relocs, then r11
needs to be valid at the call for lazy linking. */
- if (HAVE_AS_PLTSEQ
- && TARGET_TLS_MARKERS)
+ if (HAVE_AS_PLTSEQ)
abi_reg = func;
}
this insn for linker plt sequence editing too. */
func_addr = gen_rtx_REG (Pmode, CTR_REGNO);
if (HAVE_AS_PLTSEQ
- && TARGET_TLS_MARKERS
&& GET_CODE (func_desc) == SYMBOL_REF)
{
rtvec v = gen_rtvec (3, func, func_desc, tlsarg);
func = rs6000_longcall_ref (func_desc, tlsarg);
/* If the longcall was implemented using PLT16 relocs, then r11
needs to be valid at the call for lazy linking. */
- if (HAVE_AS_PLTSEQ
- && TARGET_TLS_MARKERS)
+ if (HAVE_AS_PLTSEQ)
abi_reg = func;
}
this insn for linker plt sequence editing too. */
func_addr = gen_rtx_REG (Pmode, CTR_REGNO);
if (HAVE_AS_PLTSEQ
- && TARGET_TLS_MARKERS
&& GET_CODE (func_desc) == SYMBOL_REF)
{
rtvec v = gen_rtvec (3, func, func_desc, tlsarg);
(match_operand:P 2 "symbol_ref_operand" "s")
(match_operand:P 3 "" "")]
UNSPEC_PLTSEQ))]
- "HAVE_AS_PLTSEQ && TARGET_TLS_MARKERS
+ "HAVE_AS_PLTSEQ
&& DEFAULT_ABI == ABI_ELFv2"
{
return rs6000_pltseq_template (operands, 0);
(match_operand:P 2 "symbol_ref_operand" "s")
(match_operand:P 3 "" "")]
UNSPEC_PLT16_HA))]
- "HAVE_AS_PLTSEQ && TARGET_TLS_MARKERS
+ "HAVE_AS_PLTSEQ
&& (DEFAULT_ABI == ABI_ELFv2 || DEFAULT_ABI == ABI_V4)"
{
return rs6000_pltseq_template (operands, 1);
(match_operand:P 2 "symbol_ref_operand" "s")
(match_operand:P 3 "" "")]
UNSPEC_PLT16_LO))]
- "HAVE_AS_PLTSEQ && TARGET_TLS_MARKERS
+ "HAVE_AS_PLTSEQ
&& (DEFAULT_ABI == ABI_ELFv2 || DEFAULT_ABI == ABI_V4)"
{
return rs6000_pltseq_template (operands, 2);
(match_operand:P 2 "symbol_ref_operand" "s")
(match_operand:P 3 "" "")]
UNSPEC_PLTSEQ))]
- "HAVE_AS_PLTSEQ && TARGET_TLS_MARKERS
+ "HAVE_AS_PLTSEQ
&& (DEFAULT_ABI == ABI_ELFv2 || DEFAULT_ABI == ABI_V4)"
{
return rs6000_pltseq_template (operands, 3);