aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@st.com>2019-09-10 10:09:27 +0200
committerChristophe Lyon <clyon@gcc.gnu.org>2019-09-10 10:09:27 +0200
commitfec08d85b0f38c46ef72606fb04ed05bc4821ffa (patch)
tree5180900fd9bbb3d45d0ac78cd5d27b2e39066d9b /gcc/config
parent1ce7625c439d111b412c069e7918babf4e776310 (diff)
downloadgcc-fec08d85b0f38c46ef72606fb04ed05bc4821ffa.zip
gcc-fec08d85b0f38c46ef72606fb04ed05bc4821ffa.tar.gz
gcc-fec08d85b0f38c46ef72606fb04ed05bc4821ffa.tar.bz2
[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
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/arm/arm.md18
1 files changed, 16 insertions, 2 deletions
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index 918271d..6513c2d 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -8270,8 +8270,15 @@
{
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. */
- legitimize_pic_address (operands[1], SImode, operands[2], operands[3],
+ legitimize_pic_address (operands[1], SImode, operands[2], pic_reg,
true /*compute_now*/);
}
else
@@ -8346,8 +8353,15 @@
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. */
- legitimize_pic_address (operands[1], SImode, operands[3], operands[4],
+ legitimize_pic_address (operands[1], SImode, operands[3], pic_reg,
true /*compute_now*/);
}
else