From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 78890 invoked by alias); 18 May 2015 09:22:22 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 78878 invoked by uid 89); 18 May 2015 09:22:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 18 May 2015 09:22:17 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DC87629; Mon, 18 May 2015 02:22:13 -0700 (PDT) Received: from [10.2.207.50] (e100706-lin.cambridge.arm.com [10.2.207.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 783C93F21B; Mon, 18 May 2015 02:22:14 -0700 (PDT) Message-ID: <5559AF44.7010901@foss.arm.com> Date: Mon, 18 May 2015 09:25:00 -0000 From: Kyrill Tkachov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: GCC Patches CC: Jeff Law Subject: [PATCH][calls.c] Remove #ifdef checks on STACK_GROWS_DOWNWARD Content-Type: multipart/mixed; boundary="------------000303050608080905040600" X-SW-Source: 2015-05/txt/msg01549.txt.bz2 This is a multi-part message in MIME format. --------------000303050608080905040600 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 794 Hi all, As per https://gcc.gnu.org/ml/gcc-patches/2015-05/msg01166.html I saw that STACK_GROWS_DOWNWARD is being checked for ifdef in a number of places unrelated to the patch in the PR, so decided to remove the ifdef checks for STACK_GROWS_DOWNWARD in a separate patch. It's fairly mechanical. Bootstrapped on x86_64 and aarch64 and tested on arm. I believe these patches are considered obvious, so I'll commit this in a day, unless someone objects, before proceeding with the changes in https://gcc.gnu.org/ml/gcc-patches/2015-05/msg01166.html 2015-05-18 Kyrylo Tkachov * calls.c: Always define STACK_GROWS_DOWNWARD as 0 or 1. (mem_overlaps_already_clobbered_arg_p): Rewrite ifdef STACK_GROWS_DOWNWARD as normal if. (expand_call): Likewise. --------------000303050608080905040600 Content-Type: text/x-patch; name="calls-stack-grows-downward.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="calls-stack-grows-downward.patch" Content-length: 1860 commit 13a36809b55631dbc2c7e7dfb564857f6fb74339 Author: Kyrylo Tkachov Date: Wed May 13 10:20:59 2015 +0100 [calls.c] Remove #ifdef checks on STACK_GROWS_DOWNWARD diff --git a/gcc/calls.c b/gcc/calls.c index caa7d60..e11b1b9 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -81,6 +81,15 @@ along with GCC; see the file COPYING3. If not see #include "tree-chkp.h" #include "rtl-chkp.h" + +/* Redefine STACK_GROWS_DOWNWARD in terms of 0 or 1. */ +#ifdef STACK_GROWS_DOWNWARD +# undef STACK_GROWS_DOWNWARD +# define STACK_GROWS_DOWNWARD 1 +#else +# define STACK_GROWS_DOWNWARD 0 +#endif + /* Like PREFERRED_STACK_BOUNDARY but in units of bytes, not bits. */ #define STACK_BYTES (PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT) @@ -1974,11 +1983,12 @@ mem_overlaps_already_clobbered_arg_p (rtx addr, unsigned HOST_WIDE_INT size) return true; else i = INTVAL (val); -#ifdef STACK_GROWS_DOWNWARD - i -= crtl->args.pretend_args_size; -#else - i += crtl->args.pretend_args_size; -#endif + + if (STACK_GROWS_DOWNWARD) + i -= crtl->args.pretend_args_size; + else + i += crtl->args.pretend_args_size; + if (ARGS_GROW_DOWNWARD) i = -i - size; @@ -2908,12 +2918,13 @@ expand_call (tree exp, rtx target, int ignore) if (pass == 0) { argblock = crtl->args.internal_arg_pointer; - argblock -#ifdef STACK_GROWS_DOWNWARD - = plus_constant (Pmode, argblock, crtl->args.pretend_args_size); -#else - = plus_constant (Pmode, argblock, -crtl->args.pretend_args_size); -#endif + if (STACK_GROWS_DOWNWARD) + argblock + = plus_constant (Pmode, argblock, crtl->args.pretend_args_size); + else + argblock + = plus_constant (Pmode, argblock, -crtl->args.pretend_args_size); + stored_args_map = sbitmap_alloc (args_size.constant); bitmap_clear (stored_args_map); } --------------000303050608080905040600--