Hi,

The code change that caused this regression was not meant to affect neon code-gen, however I missed the REG fall through.  This patch makes sure we only get the left-hand of the PLUS if it is indeed a PLUS expr.

I suggest that in gcc-11 this code is cleaned up, as I do not think we even need the overlap checks, NEON only loads from or stores to FP registers and these can't be used in its addressing modes.

Bootstrapped arm-linux-gnueabihf with '--enable-checking=yes,rtl' for armv7-a and amrv8-a.

Is this OK for trunk?

gcc/ChangeLog:
2020-04-27  Andre Vieira  <andre.simoesdiasvie...@arm.com>

        * config/arm/arm.c (output_move_neon): Only get the first operand,
        if addr is PLUS.

diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 
0151bda90d961ae1a001c61cd5e94d6ec67e3aea..74454dddbb948a5d37f502e8e2146a81cb83d58b
 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -20145,7 +20145,8 @@ output_move_neon (rtx *operands)
        }
       /* Fall through.  */
     case PLUS:
-      addr = XEXP (addr, 0);
+      if (GET_CODE (addr) == PLUS)
+       addr = XEXP (addr, 0);
       /* Fall through.  */
     case LABEL_REF:
       {

Reply via email to