From patchwork Fri Dec 9 16:56:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Preudhomme X-Patchwork-Id: 87529 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp408272qgi; Fri, 9 Dec 2016 08:57:06 -0800 (PST) X-Received: by 10.84.150.231 with SMTP id h94mr160062380plh.3.1481302626605; Fri, 09 Dec 2016 08:57:06 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id o12si34687283plg.84.2016.12.09.08.57.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Dec 2016 08:57:06 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-444035-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; spf=pass (google.com: domain of gcc-patches-return-444035-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-444035-patch=linaro.org@gcc.gnu.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=PL6majT9iSOIYu9X6ZaF2JNmeYEiyQzOwWRniBuNy7VS/CjKbd /fo+qPs1XeAU8Ke7UWV6WuIuQrswkBWlRL9TENma3OTdyDi6YRwdUFJr17PUItsY MTFuMWyN+D7sn1pGl/yJe9HXMFxKNyM+FHotEZy/q97QpLX+3Nl/sircM= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=FlheqRfOmT6xZ95p3lLCdmEK1DU=; b=V4WquZDldxD3gbcA3uKN g3moyTo+3wCdLECa90vSghtIPLgayftIW5ArbaDgY6iieNwiIlTNuUn5ivlRXQtV HHPa68Qd4IBQyP0FO2hNBw0S0Jv1xstKKPN20zSZonDtupT5L7OT/HP+v0tGLxdh 4ZyKg4HQ9e5RCJ/HTlNoKEA= Received: (qmail 92310 invoked by alias); 9 Dec 2016 16:56:51 -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 91794 invoked by uid 89); 9 Dec 2016 16:56:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.9 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=CORE, Hx-languages-length:2696, H*MI:52ab, H*M:52ab 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; Fri, 09 Dec 2016 16:56:40 +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 DD980CF6; Fri, 9 Dec 2016 08:56:38 -0800 (PST) Received: from [10.2.206.52] (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2A8423F445; Fri, 9 Dec 2016 08:56:38 -0800 (PST) To: Kyrill Tkachov , Ramana Radhakrishnan , Richard Earnshaw , "gcc-patches@gcc.gnu.org" From: Thomas Preudhomme Subject: [PATCH, GCC/ARM] Define arm_arch_core_flags in a single file Message-ID: Date: Fri, 9 Dec 2016 16:56:36 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 X-IsSubscribed: yes Hi, This patch moves the definition of arm_arch_core_flags along with the declaration of its structure element type to common/config/arm/arm-common.c so that it is not *defined* in all object files including tm.h. Otherwise, GCC gets bloated with as many copy of that array as there is file including tm.h and executable as well given that crtbegin gets a copy too. ChangeLog entry is as follows: *** gcc/ChangeLog *** 2016-12-09 Thomas Preud'homme * config/arm/arm-opts.h: Move struct arm_arch_core_flag and arm_arch_core_flags to ... * common/config/arm/arm-common.c: There. Testing: successfully built GCC configured with --with-cpu=cortex-a15 and optional_thumb testcases pass (without any option for -1 and -2, with -mcpu=cortex-m3 for -3 to satisfy requirements): build is working and feature as well. Is this ok for stage3? Best regards, Thomas diff --git a/gcc/common/config/arm/arm-common.c b/gcc/common/config/arm/arm-common.c index 473417a2e5f04488197c27ead2b65680bddec274..c0de5d2563ffbe0149bc5b089c4b74f177e4f740 100644 --- a/gcc/common/config/arm/arm-common.c +++ b/gcc/common/config/arm/arm-common.c @@ -98,6 +98,26 @@ arm_rewrite_mcpu (int argc, const char **argv) return arm_rewrite_selected_cpu (argv[argc - 1]); } +struct arm_arch_core_flag +{ + const char *const name; + const arm_feature_set flags; +}; + +static const struct arm_arch_core_flag arm_arch_core_flags[] = +{ +#undef ARM_CORE +#define ARM_CORE(NAME, X, IDENT, ARCH, FLAGS, COSTS) \ + {NAME, FLAGS}, +#include "config/arm/arm-cores.def" +#undef ARM_CORE +#undef ARM_ARCH +#define ARM_ARCH(NAME, CORE, ARCH, FLAGS) \ + {NAME, FLAGS}, +#include "config/arm/arm-arches.def" +#undef ARM_ARCH +}; + /* Called by the driver to check whether the target denoted by current command line options is a Thumb-only target. ARGV is an array of -march and -mcpu values (ie. it contains the rhs after the equal diff --git a/gcc/config/arm/arm-opts.h b/gcc/config/arm/arm-opts.h index 6971534a562e7b37a67d9a20f40f29b5f00dd9bc..e06fedbcf5c075a07899e641a7ea2273144eb762 100644 --- a/gcc/config/arm/arm-opts.h +++ b/gcc/config/arm/arm-opts.h @@ -79,24 +79,4 @@ enum arm_tls_type { TLS_GNU, TLS_GNU2 }; - -struct arm_arch_core_flag -{ - const char *const name; - const arm_feature_set flags; -}; - -static const struct arm_arch_core_flag arm_arch_core_flags[] = -{ -#undef ARM_CORE -#define ARM_CORE(NAME, X, IDENT, ARCH, FLAGS, COSTS) \ - {NAME, FLAGS}, -#include "arm-cores.def" -#undef ARM_CORE -#undef ARM_ARCH -#define ARM_ARCH(NAME, CORE, ARCH, FLAGS) \ - {NAME, FLAGS}, -#include "arm-arches.def" -#undef ARM_ARCH -}; #endif