From patchwork Wed Dec 6 15:26:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 120871 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp7191458qgn; Wed, 6 Dec 2017 07:27:11 -0800 (PST) X-Google-Smtp-Source: AGs4zMYaU6tzx8C9WpIGi2i/27UAVM/jaHgXoTSPh9sBJC/gqNBmZT3W6s/N1xH7u8z+O4mH54us X-Received: by 10.99.191.1 with SMTP id v1mr21340542pgf.93.1512574031467; Wed, 06 Dec 2017 07:27:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512574031; cv=none; d=google.com; s=arc-20160816; b=Of5MJVQ8BeajJ2vR7csMr2NEyUwAOVSHzWmoSjWeUahLTh60KhVrQkTHEYS8AqEz2g vsSYXzvmrmW79tQe9X1vn0XICR7IHhNedg9Pd1j4jImElGz3HtXW7q7h005iyzfVEecL 6aRUXz5YhjgoZKPGUhOMTyZurE7HOXrwhEd1zwkpWG8zQkZkzVH+YnYt9V63oYJbE/JZ BQG+LdFFpSBSpWLAWB6k2Zze4F+U6+5uH8V5THGRYrtqsOJLF0iAoqnTcTr7hgQhuNoz xFpALZWgxGORnoDbGZYInTyuMlsEYvelVRu1bAU/bc6YrsLCKfLl6rbkpf3yf0dnRbbt 4R1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:mail-followup-to:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=aT/umexLoPUYM/6AAEBZ8PKMFKuj35Ke7cNg9QY9AL8=; b=0eh2qCp07VKdL7NcXBWo4eFIB1epszx9omZXBkwwkl1CNTO/wH0B6E3zxVvrZdKVAc rDwsKNB15Z4zDeV8T2WUxo509sbZsUkhtvKZx5okHsEZ41iu/5Qoi5jPrrB+whKV5szp 0S8j5Z86aAyeUYXykse2Z7wwka4rEbtd42t+BJuh5PJkz1vA+PCimSWGYIxdy0N9h9O8 9et1DG0QAntwEnwqEVMOHokG2khVJT/3og1xnR0dlrRaiavRmHcKlIGKHGoq6EuCHycn YCufw47/519Tnne9zAGBcAZiOMIp98b5H6LIDfyPz6uslCur+iG+fuCPSb2wn7ZnZExQ f3ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=VZEz2L67; spf=pass (google.com: domain of gcc-patches-return-468617-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-468617-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id e33si2129136pld.518.2017.12.06.07.27.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Dec 2017 07:27:11 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-468617-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=VZEz2L67; spf=pass (google.com: domain of gcc-patches-return-468617-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-468617-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type; q=dns; s=default; b=lxLsfUk4KwaIBw+2 ygGLiG5RhBm1FJpWU0kp5PRb2pxCPlAY+dTqlwbudnsR9p9HVqk5U4nkrJ6tNN6C fHt8dRoAL+Ao8Z3tTcAUtegGFnyV8jNxTxzdrrkeiSzO0F4EzzlgpB620e98Dt28 3ZE7jcxPP3W5sGWf8AfvJAOGnYk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type; s=default; bh=VDDrlcSBRGguDIOdFNOr30 2oM7s=; b=VZEz2L674NcW8UGyfvex51toXenuu71uSfrLqg5/VTWPZabi13vqqf k8h5QzBnQ5B1HTvMugRDUz3bPSW1WQ74/qH/C7M27dZgdg9Z6UgtTHrEC6CjCQg4 RhfLIjYwIIrKAUKfzwuM+m6KM3ws+e+RhvCln2l3L8hD8yu2y1ajc= Received: (qmail 27677 invoked by alias); 6 Dec 2017 15:26:59 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 27665 invoked by uid 89); 6 Dec 2017 15:26:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wm0-f50.google.com Received: from mail-wm0-f50.google.com (HELO mail-wm0-f50.google.com) (74.125.82.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 06 Dec 2017 15:26:57 +0000 Received: by mail-wm0-f50.google.com with SMTP id 9so7852948wme.4 for ; Wed, 06 Dec 2017 07:26:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:mail-followup-to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version; bh=aT/umexLoPUYM/6AAEBZ8PKMFKuj35Ke7cNg9QY9AL8=; b=jkN7fq9U2TV/rbW3FrqbFVKoibgBcs/H7g4a3/CaCPL700nPm1LUk4K9EHeLHw8vRy MfnT106wUbETPFIYw7guNWGsJYOqyON9YTAlTBrUJ1sf9obmuwplyUvqWQpI0cny5aRO iEHIDJ8kKgTATm1foK4Qi32El46v6Ah1esmJLA4H13QUVhBXZWvuWmlI13U+g1I1yKj7 cfg1pjdA664MSl51KZ0Z8GeoVwgOBt3ChCvo8SbaaSuwH0bnQIDW4PkoPDC2zUZxWi1y apkcnLtJJ6kThuyQBJPjDePqK2eUv/3EubVGnZznkaesOAUr6B2qUSZnHk1aQ9RzHWuL nEIg== X-Gm-Message-State: AKGB3mIyp5zeUeKq2ECl1sx+dy73dWOGSV+BYjAEYfAQTd+th6R8qRsb oeiBt0fYPju11HbUeBHjhJJlngeadPA= X-Received: by 10.28.215.74 with SMTP id o71mr12489166wmg.46.1512574015029; Wed, 06 Dec 2017 07:26:55 -0800 (PST) Received: from localhost (188.29.165.206.threembb.co.uk. [188.29.165.206]) by smtp.gmail.com with ESMTPSA id a71sm3069445wme.33.2017.12.06.07.26.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Dec 2017 07:26:54 -0800 (PST) From: Richard Sandiford To: Richard Biener Mail-Followup-To: Richard Biener , GCC Patches , richard.sandiford@linaro.org Cc: GCC Patches Subject: Make build_vector static References: <87shcxl2ka.fsf@linaro.org> <87efohkohu.fsf@linaro.org> <87efof9a6h.fsf@linaro.org> <87fu8nao27.fsf@linaro.org> Date: Wed, 06 Dec 2017 15:26:52 +0000 In-Reply-To: <87fu8nao27.fsf@linaro.org> (Richard Sandiford's message of "Wed, 06 Dec 2017 15:11:44 +0000") Message-ID: <87r2s798sj.fsf_-_@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 After the previous patches, the only remaining uses of build_vector are in the selftests in tree.c. This patch makes it static and moves it to the selftest part of the file. Tested on aarch64-linux-gnu, x86_64-linux-gnu and powerpc64le-linux-gnu. Also spot-checked on sparc64-linux-gnu. OK to install? Thanks, Richard 2017-12-06 Richard Sandiford gcc/ * tree.c (build_vector): Delete. * tree.h (build_vector): Make static and move into the self-testing block. Index: gcc/tree.c =================================================================== --- gcc/tree.c 2017-12-06 14:48:52.891162052 +0000 +++ gcc/tree.c 2017-12-06 14:49:10.295445836 +0000 @@ -1736,18 +1736,6 @@ make_vector (unsigned log2_npatterns, } /* Return a new VECTOR_CST node whose type is TYPE and whose values - are given by VALS. */ - -tree -build_vector (tree type, vec vals MEM_STAT_DECL) -{ - gcc_assert (vals.length () == TYPE_VECTOR_SUBPARTS (type)); - tree_vector_builder builder (type, vals.length (), 1); - builder.splice (vals); - return builder.build (); -} - -/* Return a new VECTOR_CST node whose type is TYPE and whose values are extracted from V, a vector of CONSTRUCTOR_ELT. */ tree @@ -14066,6 +14054,18 @@ test_labels () ASSERT_FALSE (FORCED_LABEL (label_decl)); } +/* Return a new VECTOR_CST node whose type is TYPE and whose values + are given by VALS. */ + +static tree +build_vector (tree type, vec vals MEM_STAT_DECL) +{ + gcc_assert (vals.length () == TYPE_VECTOR_SUBPARTS (type)); + tree_vector_builder builder (type, vals.length (), 1); + builder.splice (vals); + return builder.build (); +} + /* Check that VECTOR_CST ACTUAL contains the elements in EXPECTED. */ static void Index: gcc/tree.h =================================================================== --- gcc/tree.h 2017-12-06 14:46:14.133599820 +0000 +++ gcc/tree.h 2017-12-06 14:49:10.296445794 +0000 @@ -4044,7 +4044,6 @@ extern tree build_int_cst (tree, HOST_WI extern tree build_int_cstu (tree type, unsigned HOST_WIDE_INT cst); extern tree build_int_cst_type (tree, HOST_WIDE_INT); extern tree make_vector (unsigned, unsigned CXX_MEM_STAT_INFO); -extern tree build_vector (tree, vec CXX_MEM_STAT_INFO); extern tree build_vector_from_ctor (tree, vec *); extern tree build_vector_from_val (tree, tree); extern void recompute_constructor_flags (tree);