From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2049) id 3A7513858020; Fri, 10 Dec 2021 16:48:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3A7513858020 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Matthew Malcomson To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/ARM/heads/morello)] calls.c: Fix store_one_arg to use any_plus_p X-Act-Checkin: gcc X-Git-Author: Alex Coplan X-Git-Refname: refs/vendors/ARM/heads/morello X-Git-Oldrev: e448e4ea47469b2f9696ede3648c264761ef6b1b X-Git-Newrev: 8449dd9211b1405f6712b4c0ab88df2978bb7827 Message-Id: <20211210164858.3A7513858020@sourceware.org> Date: Fri, 10 Dec 2021 16:48:58 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Dec 2021 16:48:58 -0000 https://gcc.gnu.org/g:8449dd9211b1405f6712b4c0ab88df2978bb7827 commit 8449dd9211b1405f6712b4c0ab88df2978bb7827 Author: Alex Coplan 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);