public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Hans-Peter Nilsson <hp@axis.com>
To: "Maciej W. Rozycki" <macro@embecosm.com>
Cc: <gcc-patches@gcc.gnu.org>, <uweigand@de.ibm.com>
Subject: Re: [PATCH] PR middle-end/103059: reload: Also accept ASHIFT with indexed addressing
Date: Mon, 8 Nov 2021 20:55:55 +0100	[thread overview]
Message-ID: <20211108195555.D6EFA203AE@pchp3.se.axis.com> (raw)
In-Reply-To: <alpine.DEB.2.20.2111031202310.18331@tpp.orcam.me.uk> (macro@embecosm.com)

> From: "Maciej W. Rozycki" <macro@embecosm.com>
> Date: Wed, 3 Nov 2021 14:53:58 +0100

> 	gcc/
> 	PR middle-end/103059
> 	* reload.c (find_reloads_address_1): Also accept the ASHIFT form 
> 	of indexed addressing.
> 	(find_reloads): Adjust accordingly.

> ---
>  gcc/reload.c |    9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> gcc-find-reloads-address-ashift.diff
> Index: gcc/gcc/reload.c
> ===================================================================
> --- gcc.orig/gcc/reload.c
> +++ gcc/gcc/reload.c
> @@ -2846,10 +2846,11 @@ find_reloads (rtx_insn *insn, int replac
>  				    i, operand_type[i], ind_levels, insn);
>  
>  	  /* If we now have a simple operand where we used to have a
> -	     PLUS or MULT, re-recognize and try again.  */
> +	     PLUS or MULT or ASHIFT, re-recognize and try again.  */
>  	  if ((OBJECT_P (*recog_data.operand_loc[i])
>  	       || GET_CODE (*recog_data.operand_loc[i]) == SUBREG)
>  	      && (GET_CODE (recog_data.operand[i]) == MULT
> +		  || GET_CODE (recog_data.operand[i]) == ASHIFT
>  		  || GET_CODE (recog_data.operand[i]) == PLUS))
>  	    {
>  	      INSN_CODE (insn) = -1;
> @@ -5562,7 +5563,8 @@ find_reloads_address_1 (machine_mode mod
>  	    return 1;
>  	  }
>  
> -	if (code0 == MULT || code0 == SIGN_EXTEND || code0 == TRUNCATE
> +	if (code0 == MULT || code0 == ASHIFT
> +	    || code0 == SIGN_EXTEND || code0 == TRUNCATE
>  	    || code0 == ZERO_EXTEND || code1 == MEM)
>  	  {
>  	    find_reloads_address_1 (mode, as, orig_op0, 1, PLUS, SCRATCH,
> @@ -5573,7 +5575,8 @@ find_reloads_address_1 (machine_mode mod
>  				    insn);
>  	  }
>  
> -	else if (code1 == MULT || code1 == SIGN_EXTEND || code1 == TRUNCATE
> +	else if (code1 == MULT || code1 == ASHIFT
> +		 || code1 == SIGN_EXTEND || code1 == TRUNCATE
>  		 || code1 == ZERO_EXTEND || code0 == MEM)
>  	  {
>  	    find_reloads_address_1 (mode, as, orig_op0, 0, PLUS, code1,
> 

I regression-tested this patch for cris-elf at
r12-4987-g14e355df3053.  No regressions compared to
r12-4987-g14e355df3053.  (JFTR, that's at regress-11,
compared to T0=2007-01-05-16:47:21).

brgds, H-P

      parent reply	other threads:[~2021-11-08 19:55 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-03 13:53 Maciej W. Rozycki
2021-11-04 18:12 ` Jeff Law
2021-11-04 21:04   ` Maciej W. Rozycki
2021-11-04 23:47     ` Jeff Law
2021-11-05  0:18       ` Maciej W. Rozycki
2021-11-09  0:26         ` Jeff Law
2021-11-10 16:41           ` Maciej W. Rozycki
2021-11-23 19:04             ` Jeff Law
2021-11-24 13:20               ` Maciej W. Rozycki
2021-11-24 13:25                 ` Richard Biener
2021-11-24 13:38                   ` Maciej W. Rozycki
2021-11-06  2:38 ` Hans-Peter Nilsson
2021-11-07 21:22   ` Maciej W. Rozycki
2021-11-08  4:15     ` Hans-Peter Nilsson
2021-11-08 10:00       ` Maciej W. Rozycki
2021-11-12 23:22         ` Hans-Peter Nilsson
2021-11-07 21:24 ` Maciej W. Rozycki
2021-11-09 11:59   ` Maciej W. Rozycki
2021-11-08 19:55 ` Hans-Peter Nilsson
2021-11-09 12:11   ` Maciej W. Rozycki
2021-11-08 19:55 ` Hans-Peter Nilsson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211108195555.D6EFA203AE@pchp3.se.axis.com \
    --to=hp@axis.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=macro@embecosm.com \
    --cc=uweigand@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).