From patchwork Tue Sep 20 14:29:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 57812 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D168D3857408 for ; Tue, 20 Sep 2022 14:30:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D168D3857408 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663684217; bh=cre9bwMyQdfIIL4F0Ov1TiBQcD1e5jDI2QqzhRK9zlQ=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Zg2Isj/Ew6FUgr1u0gJU5Z6n9gxjdICZNlTD5jiw0pEJt1GCd1uscmn8KD2kd3X2d ckdaLsjIKqXY5ekXp50iKkqeTMvZsyRme6HJjxNxiGjZC2pH/lBPLiNifWzCs8KONO QS8v6XNLucqDrPgmnXaOkAa7CbGRWsKVEj7Myri8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id BA067385AC1C for ; Tue, 20 Sep 2022 14:29:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BA067385AC1C 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 CAA86ED1 for ; Tue, 20 Sep 2022 07:29:08 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.98.62]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E8E443F73D for ; Tue, 20 Sep 2022 07:29:01 -0700 (PDT) To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: [pushed] aarch64: Fix GTY markup for arm_sve.h [PR106491] Date: Tue, 20 Sep 2022 15:29:00 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Spam-Status: No, score=-47.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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-Patchwork-Original-From: Richard Sandiford via Gcc-patches From: Richard Sandiford Reply-To: Richard Sandiford Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" It turns out that GTY(()) markers in definitions like: GTY(()) tree scalar_types[NUM_VECTOR_TYPES]; are not effective and are silently ignored. The GTY(()) has to come after an extern or static. The externs associated with the SVE ACLE GTY variables are in aarch64-sve-builtins.h. This file is not in tm_include_list because we don't want every target-facing file to include it. It therefore isn't in the list of GC header files either. In this case that's a blessing in disguise, since the variables belong to a namespace and gengtype doesn't understand namespaces. I think the fix is instead to add an extra extern before each variable declaration, similarly to varasm.cc and vtable-verify.cc. (This works due to a "using namespace" at the end of the file.) Tested on aarch64-linux-gnu & pushed. I'll backport to branches over the next few days. Richard gcc/ PR target/106491 * config/aarch64/aarch64-sve-builtins.cc (scalar_types) (acle_vector_types, acle_svpattern, acle_svprfop): Add GTY markup to (new) extern declarations instead of to the main definition. --- gcc/config/aarch64/aarch64-sve-builtins.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gcc/config/aarch64/aarch64-sve-builtins.cc b/gcc/config/aarch64/aarch64-sve-builtins.cc index 9d78b270e47..12d9beee4da 100644 --- a/gcc/config/aarch64/aarch64-sve-builtins.cc +++ b/gcc/config/aarch64/aarch64-sve-builtins.cc @@ -530,7 +530,8 @@ static CONSTEXPR const function_group_info function_groups[] = { }; /* The scalar type associated with each vector type. */ -GTY(()) tree scalar_types[NUM_VECTOR_TYPES]; +extern GTY(()) tree scalar_types[NUM_VECTOR_TYPES]; +tree scalar_types[NUM_VECTOR_TYPES]; /* The single-predicate and single-vector types, with their built-in "__SV..._t" name. Allow an index of NUM_VECTOR_TYPES, which always @@ -538,13 +539,16 @@ GTY(()) tree scalar_types[NUM_VECTOR_TYPES]; static GTY(()) tree abi_vector_types[NUM_VECTOR_TYPES + 1]; /* Same, but with the arm_sve.h "sv..._t" name. */ -GTY(()) tree acle_vector_types[MAX_TUPLE_SIZE][NUM_VECTOR_TYPES + 1]; +extern GTY(()) tree acle_vector_types[MAX_TUPLE_SIZE][NUM_VECTOR_TYPES + 1]; +tree acle_vector_types[MAX_TUPLE_SIZE][NUM_VECTOR_TYPES + 1]; /* The svpattern enum type. */ -GTY(()) tree acle_svpattern; +extern GTY(()) tree acle_svpattern; +tree acle_svpattern; /* The svprfop enum type. */ -GTY(()) tree acle_svprfop; +extern GTY(()) tree acle_svprfop; +tree acle_svprfop; /* The list of all registered function decls, indexed by code. */ static GTY(()) vec *registered_functions;