From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 9F1233A1B413 for ; Fri, 13 Nov 2020 08:12:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9F1233A1B413 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5314C142F for ; Fri, 13 Nov 2020 00:12:47 -0800 (PST) Received: from localhost (e121540-lin.manchester.arm.com [10.32.98.126]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EFA613F718 for ; Fri, 13 Nov 2020 00:12:46 -0800 (PST) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: [03/23] reginfo: Add a global_reg_set References: Date: Fri, 13 Nov 2020 08:12:45 +0000 In-Reply-To: (Richard Sandiford's message of "Fri, 13 Nov 2020 08:10:54 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2020 08:12:49 -0000 A later patch wants to use the set of global registers as a HARD_REG_SET rather than a bool/char array. Most other arrays already have a HARD_REG_SET counterpart, but this one didn't. gcc/ * hard-reg-set.h (global_reg_set): Declare. * reginfo.c (global_reg_set): New variable. (init_reg_sets_1, globalize_reg): Update it when globalizing registers. --- gcc/hard-reg-set.h | 2 ++ gcc/reginfo.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/gcc/hard-reg-set.h b/gcc/hard-reg-set.h index 1ec1b4e4aa0..787da3a4f02 100644 --- a/gcc/hard-reg-set.h +++ b/gcc/hard-reg-set.h @@ -359,6 +359,8 @@ hard_reg_set_iter_next (hard_reg_set_iterator *iter, unsigned *regno) extern char global_regs[FIRST_PSEUDO_REGISTER]; +extern HARD_REG_SET global_reg_set; + class simplifiable_subreg; class subreg_shape; diff --git a/gcc/reginfo.c b/gcc/reginfo.c index e34b74af9f1..cc7d17460eb 100644 --- a/gcc/reginfo.c +++ b/gcc/reginfo.c @@ -91,6 +91,9 @@ static const char initial_call_used_regs[] = CALL_USED_REGISTERS; and are also considered fixed. */ char global_regs[FIRST_PSEUDO_REGISTER]; +/* The set of global registers. */ +HARD_REG_SET global_reg_set; + /* Declaration for the global register. */ tree global_regs_decl[FIRST_PSEUDO_REGISTER]; @@ -390,6 +393,7 @@ init_reg_sets_1 (void) { fixed_regs[i] = call_used_regs[i] = 1; SET_HARD_REG_BIT (fixed_reg_set, i); + SET_HARD_REG_BIT (global_reg_set, i); } } @@ -724,6 +728,7 @@ globalize_reg (tree decl, int i) global_regs[i] = 1; global_regs_decl[i] = decl; + SET_HARD_REG_BIT (global_reg_set, i); /* If we're globalizing the frame pointer, we need to set the appropriate regs_invalidated_by_call bit, even if it's already -- 2.17.1