Hi Jackson

On Tuesday 10 July 2018 09:37 AM, Jackson Woodruff wrote:
Hi all,

This patch resolves PR86014.  It does so by noticing that the last load may clobber the address register without issue (regardless of where it exists in the final ldp/stp sequence).  That check has been changed so that the last register may be clobbered and the testcase (gcc.target/aarch64/ldp_stp_10.c) now passes.

Bootstrap and regtest OK.

OK for trunk?

Jackson

Changelog:

gcc/

2018-06-25  Jackson Woodruff  <jackson.woodr...@arm.com>

        PR target/86014
        * config/aarch64/aarch64.c (aarch64_operands_adjust_ok_for_ldpstp):
        Remove address clobber check on last register.

This looks good to me but you will need a maintainer to approve it. The only
thing I would add is that if you could move the comment on top of the for loop
to this patch. That is, keep the original
/* Check if the addresses are clobbered by load.  */
in your [1/2] and make the comment change in [2/2].

diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 
d0e9b2d464183eecc8cc7639ca3e981d2ff243ba..feffe8ebdbd4efd0ffc09834547767ceec46f4e4
 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -17074,7 +17074,7 @@ aarch64_operands_adjust_ok_for_ldpstp (rtx *operands, 
bool load,
   /* Only the last register in the order in which they occur
      may be clobbered by the load.  */
   if (load)
-    for (int i = 0; i < num_instructions; i++)
+    for (int i = 0; i < num_instructions - 1; i++)
       if (reg_mentioned_p (reg[i], mem[i]))
        return false;


Thanks
Sudi

Reply via email to