public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/ARM/heads/morello)] calls.c: Fix store_one_arg to use any_plus_p
@ 2021-12-10 16:48 Matthew Malcomson
  0 siblings, 0 replies; only message in thread
From: Matthew Malcomson @ 2021-12-10 16:48 UTC (permalink / raw)
  To: gcc-cvs

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);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-12-10 16:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-10 16:48 [gcc(refs/vendors/ARM/heads/morello)] calls.c: Fix store_one_arg to use any_plus_p Matthew Malcomson

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).