From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1130) id 692E83858018; Wed, 21 Sep 2022 13:17:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 692E83858018 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663766272; bh=5BW4ROUh9ne4Y/UvqE4yeBZASTw4imcAWQKn1HcTj0I=; h=From:To:Subject:Date:From; b=dRUdlU7hcgb9F3QFbAJeCtdLEcF3zRbZnjh4f5dwoyjYxpK4NxJLrN1UjmWenwXd8 0ANOnuR1hOBYX0hCEbm2XIgpDf0vQsglGhEYSP/7KrLJbx/+L5YKLGFw3vWB4U4KUt GUJszXksuzK37UIUg8hh4V0sps53oiOsCxvyF7Qs= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Richard Sandiford To: gcc-cvs@gcc.gnu.org Subject: [gcc r10-10996] aarch64: Fix GTY markup for arm_sve.h [PR106491] X-Act-Checkin: gcc X-Git-Author: Richard Sandiford X-Git-Refname: refs/heads/releases/gcc-10 X-Git-Oldrev: fa60d4e103095e99aba1dd8f1186a359ab4f8ec5 X-Git-Newrev: c3fda946dedbb08df8eb46bb0120938c08f09742 Message-Id: <20220921131752.692E83858018@sourceware.org> Date: Wed, 21 Sep 2022 13:17:52 +0000 (GMT) List-Id: https://gcc.gnu.org/g:c3fda946dedbb08df8eb46bb0120938c08f09742 commit r10-10996-gc3fda946dedbb08df8eb46bb0120938c08f09742 Author: Richard Sandiford Date: Wed Sep 21 14:17:43 2022 +0100 aarch64: Fix GTY markup for arm_sve.h [PR106491] 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.) 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. (cherry picked from commit 6bf5a704d36243c4c04b17a9408ebe881beb0051) Diff: --- 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 336a1db662b..cb4564c821c 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;