Commit fec08d85 by Christophe Lyon Committed by Christophe Lyon

[ARM/FDPIC v6 21/24] [ARM] FDPIC: Handle stack-protector combined patterns

The recent stack_protect_combined_set_insn and
stack_protect_combined_test_insn force recomputing of GOT base, but
need to take into account that in FDPIC mode, the PIC register is
fixed by the ABI (r9).

2019-09-10  Christophe Lyon  <christophe.lyon@st.com>

	gcc/
	* config/arm/arm.md (stack_protect_combined_set_insn): Handle
	FDPIC mode.
	(stack_protect_combined_test_insn): Likewise.

From-SVN: r275582
parent 1ce7625c
2019-09-10 Christophe Lyon <christophe.lyon@st.com> 2019-09-10 Christophe Lyon <christophe.lyon@st.com>
* config/arm/arm.md (stack_protect_combined_set_insn): Handle
FDPIC mode.
(stack_protect_combined_test_insn): Likewise.
2019-09-10 Christophe Lyon <christophe.lyon@st.com>
Mickaël Guêné <mickael.guene@st.com> Mickaël Guêné <mickael.guene@st.com>
* config/arm/arm.c (arm_load_tp): Add FDPIC support. * config/arm/arm.c (arm_load_tp): Add FDPIC support.
......
...@@ -8270,8 +8270,15 @@ ...@@ -8270,8 +8270,15 @@
{ {
if (flag_pic) if (flag_pic)
{ {
rtx pic_reg;
if (TARGET_FDPIC)
pic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM);
else
pic_reg = operands[3];
/* Forces recomputing of GOT base now. */ /* Forces recomputing of GOT base now. */
legitimize_pic_address (operands[1], SImode, operands[2], operands[3], legitimize_pic_address (operands[1], SImode, operands[2], pic_reg,
true /*compute_now*/); true /*compute_now*/);
} }
else else
...@@ -8346,8 +8353,15 @@ ...@@ -8346,8 +8353,15 @@
if (flag_pic) if (flag_pic)
{ {
rtx pic_reg;
if (TARGET_FDPIC)
pic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM);
else
pic_reg = operands[4];
/* Forces recomputing of GOT base now. */ /* Forces recomputing of GOT base now. */
legitimize_pic_address (operands[1], SImode, operands[3], operands[4], legitimize_pic_address (operands[1], SImode, operands[3], pic_reg,
true /*compute_now*/); true /*compute_now*/);
} }
else else
......
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