Commit 6ae67989 by John David Anglin

re PR target/83984 (ld: The value 0x8000000000005 does not fit when applying the relocation DIR21L)

	PR target/83984
	* config/pa/pa.md: Load address of PIC label using the linkage table
	if the label is nonlocal.

From-SVN: r257672
parent 4ce5745c
2018-02-14 John David Anglin <danglin@gcc.gnu.org>
PR target/83984
* config/pa/pa.md: Load address of PIC label using the linkage table
if the label is nonlocal.
2018-02-14 Kelvin Nilsen <kelvin@gcc.gnu.org> 2018-02-14 Kelvin Nilsen <kelvin@gcc.gnu.org>
* config/rs6000/rs6000.c (rs6000_option_override_internal): Issue * config/rs6000/rs6000.c (rs6000_option_override_internal): Issue
......
...@@ -2536,17 +2536,18 @@ ...@@ -2536,17 +2536,18 @@
xoperands[0] = operands[0]; xoperands[0] = operands[0];
xoperands[1] = operands[1]; xoperands[1] = operands[1];
xoperands[2] = gen_label_rtx ();
if (GET_CODE (operands[1]) == LABEL_REF
&& !LABEL_REF_NONLOCAL_P (operands[1]))
{
xoperands[2] = gen_label_rtx ();
(*targetm.asm_out.internal_label) (asm_out_file, \"L\", (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
CODE_LABEL_NUMBER (xoperands[2])); CODE_LABEL_NUMBER (xoperands[2]));
output_asm_insn (\"mfia %0\", xoperands); output_asm_insn (\"mfia %0\", xoperands);
/* If we're trying to load the address of a label that happens to be /* If we're trying to load the address of a label that happens to be
close, then we can use a shorter sequence. */ close, then we can use a shorter sequence. */
if (GET_CODE (operands[1]) == LABEL_REF if (INSN_ADDRESSES_SET_P ()
&& !LABEL_REF_NONLOCAL_P (operands[1])
&& INSN_ADDRESSES_SET_P ()
&& abs (INSN_ADDRESSES (INSN_UID (XEXP (operands[1], 0))) && abs (INSN_ADDRESSES (INSN_UID (XEXP (operands[1], 0)))
- INSN_ADDRESSES (INSN_UID (insn))) < 8100) - INSN_ADDRESSES (INSN_UID (insn))) < 8100)
output_asm_insn (\"ldo %1-%2(%0),%0\", xoperands); output_asm_insn (\"ldo %1-%2(%0),%0\", xoperands);
...@@ -2555,6 +2556,21 @@ ...@@ -2555,6 +2556,21 @@
output_asm_insn (\"addil L%%%1-%2,%0\", xoperands); output_asm_insn (\"addil L%%%1-%2,%0\", xoperands);
output_asm_insn (\"ldo R%%%1-%2(%0),%0\", xoperands); output_asm_insn (\"ldo R%%%1-%2(%0),%0\", xoperands);
} }
}
else
{
/* Load using linkage table. */
if (TARGET_64BIT)
{
output_asm_insn (\"addil LT%%%1,%%r27\", xoperands);
output_asm_insn (\"ldd RT%%%1(%0),%0\", xoperands);
}
else
{
output_asm_insn (\"addil LT%%%1,%%r19\", xoperands);
output_asm_insn (\"ldw RT%%%1(%0),%0\", xoperands);
}
}
return \"\"; return \"\";
}" }"
[(set_attr "type" "multi") [(set_attr "type" "multi")
...@@ -2570,8 +2586,11 @@ ...@@ -2570,8 +2586,11 @@
xoperands[0] = operands[0]; xoperands[0] = operands[0];
xoperands[1] = operands[1]; xoperands[1] = operands[1];
xoperands[2] = gen_label_rtx ();
if (GET_CODE (operands[1]) == LABEL_REF
&& !LABEL_REF_NONLOCAL_P (operands[1]))
{
xoperands[2] = gen_label_rtx ();
output_asm_insn (\"bl .+8,%0\", xoperands); output_asm_insn (\"bl .+8,%0\", xoperands);
output_asm_insn (\"depi 0,31,2,%0\", xoperands); output_asm_insn (\"depi 0,31,2,%0\", xoperands);
(*targetm.asm_out.internal_label) (asm_out_file, \"L\", (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
...@@ -2579,9 +2598,7 @@ ...@@ -2579,9 +2598,7 @@
/* If we're trying to load the address of a label that happens to be /* If we're trying to load the address of a label that happens to be
close, then we can use a shorter sequence. */ close, then we can use a shorter sequence. */
if (GET_CODE (operands[1]) == LABEL_REF if (INSN_ADDRESSES_SET_P ()
&& !LABEL_REF_NONLOCAL_P (operands[1])
&& INSN_ADDRESSES_SET_P ()
&& abs (INSN_ADDRESSES (INSN_UID (XEXP (operands[1], 0))) && abs (INSN_ADDRESSES (INSN_UID (XEXP (operands[1], 0)))
- INSN_ADDRESSES (INSN_UID (insn))) < 8100) - INSN_ADDRESSES (INSN_UID (insn))) < 8100)
output_asm_insn (\"ldo %1-%2(%0),%0\", xoperands); output_asm_insn (\"ldo %1-%2(%0),%0\", xoperands);
...@@ -2590,6 +2607,13 @@ ...@@ -2590,6 +2607,13 @@
output_asm_insn (\"addil L%%%1-%2,%0\", xoperands); output_asm_insn (\"addil L%%%1-%2,%0\", xoperands);
output_asm_insn (\"ldo R%%%1-%2(%0),%0\", xoperands); output_asm_insn (\"ldo R%%%1-%2(%0),%0\", xoperands);
} }
}
else
{
/* Load using linkage table. */
output_asm_insn (\"addil LT%%%1,%%r19\", xoperands);
output_asm_insn (\"ldw RT%%%1(%0),%0\", xoperands);
}
return \"\"; return \"\";
}" }"
[(set_attr "type" "multi") [(set_attr "type" "multi")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment