diff mbox series

[Arm] : Fix bootstrap failure with rtl-checking

Message ID 871d4c7a-db80-c574-fc22-4d748742c5a1@arm.com
State New
Headers show
Series [Arm] : Fix bootstrap failure with rtl-checking | expand

Commit Message

Andre Vieira (lists) April 27, 2020, 1:21 p.m. UTC
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.simoesdiasvieira@arm.com>

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

Comments

Kyrylo Tkachov April 27, 2020, 1:22 p.m. UTC | #1
> -----Original Message-----
> From: Andre Vieira (lists) <andre.simoesdiasvieira@arm.com>
> Sent: 27 April 2020 14:22
> To: gcc-patches@gcc.gnu.org
> Cc: Kyrylo Tkachov <Kyrylo.Tkachov@arm.com>
> Subject: [PATCH][GCC][Arm]: Fix bootstrap failure with rtl-checking
> 
> 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?

Ok.
Thanks,
Kyrill

> 
> gcc/ChangeLog:
> 2020-04-27  Andre Vieira  <andre.simoesdiasvieira@arm.com>
> 
>          * config/arm/arm.c (output_move_neon): Only get the first operand,
>          if addr is PLUS.
Ramana Radhakrishnan May 19, 2020, 10:27 p.m. UTC | #2
On Mon, Apr 27, 2020 at 2:22 PM Andre Vieira (lists)
<andre.simoesdiasvieira@arm.com> wrote:
>
> 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?
>

Also for GCC-10  ?

Ramana

> gcc/ChangeLog:
> 2020-04-27  Andre Vieira  <andre.simoesdiasvieira@arm.com>
>
>          * config/arm/arm.c (output_move_neon): Only get the first operand,
>          if addr is PLUS.
>
diff mbox series

Patch

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:
       {