public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Matthew Malcomson <matmal01@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc(refs/vendors/ARM/heads/morello)] calls.c: Fix store_one_arg to use any_plus_p
Date: Fri, 10 Dec 2021 16:48:58 +0000 (GMT)	[thread overview]
Message-ID: <20211210164858.3A7513858020@sourceware.org> (raw)

https://gcc.gnu.org/g:8449dd9211b1405f6712b4c0ab88df2978bb7827

commit 8449dd9211b1405f6712b4c0ab88df2978bb7827
Author: Alex Coplan <alex.coplan@arm.com>
Date:   Fri Oct 29 12:46:37 2021 +0100

    calls.c: Fix store_one_arg to use any_plus_p
    
    This is a small bugfix in preparation for the patch series implementing
    the new Morello varargs PCS.
    
    The store_one_arg function was using GET_CODE (...) == PLUS to check for
    a pointer plus an offset for stack slot rtxes, but on purecap the stack
    slot will be a capability and will use POINTER_PLUS, so these checks
    were failing, leading to severe pessimization of code that stores
    arguments on the stack.
    
    Fixed by using any_plus_p for these checks.
    
    gcc/ChangeLog:
    
            * calls.c (store_one_arg): Use any_plus_p to also handle POINTER_PLUS.

Diff:
---
 gcc/calls.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/calls.c b/gcc/calls.c
index 7fd56fcefa7..5f6aa9d62a3 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -5797,7 +5797,7 @@ store_one_arg (struct arg_data *arg, rtx argblock, int flags,
 	    {
 	      /* stack_slot is negative, but we want to index stack_usage_map
 		 with positive values.  */
-	      if (GET_CODE (XEXP (arg->stack_slot, 0)) == PLUS)
+	      if (any_plus_p (XEXP (arg->stack_slot, 0)))
 		{
 		  rtx offset = XEXP (XEXP (arg->stack_slot, 0), 1);
 		  upper_bound = -rtx_to_poly_int64 (offset) + 1;
@@ -5809,7 +5809,7 @@ store_one_arg (struct arg_data *arg, rtx argblock, int flags,
 	    }
 	  else
 	    {
-	      if (GET_CODE (XEXP (arg->stack_slot, 0)) == PLUS)
+	      if (any_plus_p (XEXP (arg->stack_slot, 0)))
 		{
 		  rtx offset = XEXP (XEXP (arg->stack_slot, 0), 1);
 		  lower_bound = rtx_to_poly_int64 (offset);


                 reply	other threads:[~2021-12-10 16:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20211210164858.3A7513858020@sourceware.org \
    --to=matmal01@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /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).