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: 704620 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tZz0s2YPnz9vF6 for ; Sat, 10 Dec 2016 03:57:01 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="sxLIByDq"; dkim-atps=neutral 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=JHwm9/CXHKtwcTsYV0JKlEWhwyBszpIoi2FsimNAPMqpBU6LWO 5IoZTYepjEGho5s63QHUWz/nY7gccNFJKK+f7t8PgscmT7bkBIVFxP/GYLPQ+LnZ DFjy7AGFOo6GkZAmTuSo+ERtMxANYFkv9VMhNjSdEOXxctGHjzJ0OPMrw= 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=sxLIByDq5ZgiB2Brs4kJ xui97OPOm+JLd+VIW1lvJvt8oHzAiy+SaY52DfhSD6xj6HzBn8ZntHBRI2PJRgZq XYrisKvtb7YAq7Cq/rFtsc3nexe7NaqOyY93ZGKehIvXOPK1rJ9S6TFqxJT9l8ZD UVahtD0nmWG/iNr/UJW/O48= 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