Hi, The unconditional reload of address operand for recognized instruction in process_address_1 prevent the patch for fixing "PR85434: Address of stack protector guard spilled to stack on ARM" proposed at [1]. The code in this patch attempt to control which registers are used to make PIC access but the reload performed by process_address_1 will use generic PIC access. This patch removes the test for the instruction to be unrecognized to do the reload, thus always avoiding to reload address operand for fixed constraints (such as "X" used in the patch).
[1] https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01838.html ChangeLog entry is as follows: *** gcc/ChangeLog *** 2018-10-03 Thomas Preud'homme <thomas.preudho...@linaro.org> * lra-constraints.c (process_address_1): Bail out for all satisfied fixed constraints. Testing: Successfully bootstrapped and regtested on: - arm-linux-gnueabihf (both Arm and Thumb2 mode) - aarch64-linux-gnu - x86_64-linux-gnu - i386-linux-gnu - sparc64-linux-gnu (gcc202) - powerpc64le-linux-gnu (gcc112) Is this ok for trunk? Best regards, Thomas
From 2831d8b886d92513c2d30d43a6a989d2bbd0ceee Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme <thomas.preudho...@linaro.org> Date: Thu, 27 Sep 2018 09:50:12 +0100 Subject: [PATCH] [PATCH, LRA] Never reload fixed form constraints memory operand Hi, The unconditional reload of address operand for recognized instruction in process_address_1 prevent the patch for fixing "PR85434: Address of stack protector guard spilled to stack on ARM" proposed at [1]. The code in this patch attempt to control which registers are used to make PIC access but the reload performed by process_address_1 will use generic PIC access. This patch removes the test for the instruction to be unrecognized to do the reload, thus always avoiding to reload address operand for fixed constraints (such as "X" used in the patch). [1] https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01838.html ChangeLog entry is as follows: *** gcc/ChangeLog *** 2018-10-03 Thomas Preud'homme <thomas.preudho...@linaro.org> * lra-constraints.c (process_address_1): Bail out for all satisfied fixed constraints. Testing: Successfully bootstrapped and regtested on: - arm-linux-gnueabihf (both Arm and Thumb2 mode) - aarch64-linux-gnu - x86_64-linux-gnu - i386-linux-gnu - sparc64-linux-gnu (gcc202) - powerpc64le-linux-gnu (gcc112) Is this ok for trunk? Best regards, Thomas --- gcc/lra-constraints.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index 774d1ff3aaa..c3edd9ef45d 100644 --- a/gcc/lra-constraints.c +++ b/gcc/lra-constraints.c @@ -3243,8 +3243,7 @@ process_address_1 (int nop, bool check_only_p, /* Do not attempt to decompose arbitrary addresses generated by combine for asm operands with loose constraints, e.g 'X'. */ else if (MEM_P (op) - && !(INSN_CODE (curr_insn) < 0 - && get_constraint_type (cn) == CT_FIXED_FORM + && !(get_constraint_type (cn) == CT_FIXED_FORM && constraint_satisfied_p (op, cn))) decompose_mem_address (&ad, op); else if (GET_CODE (op) == SUBREG -- 2.19.0