From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31645 invoked by alias); 15 Dec 2016 16:05:57 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 31582 invoked by uid 89); 15 Dec 2016 16:05:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.0 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy= 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; Thu, 15 Dec 2016 16:05:55 +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 C9E081516; Thu, 15 Dec 2016 08:05:53 -0800 (PST) Received: from e105689-lin.cambridge.arm.com (e105689-lin.cambridge.arm.com [10.2.207.32]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7BDD33F445 for ; Thu, 15 Dec 2016 08:05:53 -0800 (PST) From: "Richard Earnshaw (lists)" Subject: [PATCH 05/21] [arm] Reduce usage of arm_selected_cpu. To: gcc-patches@gcc.gnu.org References: Message-ID: <7968a4f7-d185-18d1-d923-21c475c4265c@arm.com> Date: Thu, 15 Dec 2016 16:05:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------74255048B07DB6BC0CACF604" X-SW-Source: 2016-12/txt/msg01380.txt.bz2 This is a multi-part message in MIME format. --------------74255048B07DB6BC0CACF604 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-length: 348 Make more use of the new data structure for initializing existing variables. * arm.c (arm_option_override): Use arm_active_target as source of information for arm_base_arch and arm_arch_name. * (arm_file_start): Use arm_active_target for core name. --- gcc/config/arm/arm.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) --------------74255048B07DB6BC0CACF604 Content-Type: text/x-patch; name="0005-arm-Reduce-usage-of-arm_selected_cpu.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0005-arm-Reduce-usage-of-arm_selected_cpu.patch" Content-length: 1259 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index a4d370c..3806226 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -3276,9 +3276,9 @@ arm_option_override (void) SUBTARGET_OVERRIDE_OPTIONS; #endif - sprintf (arm_arch_name, "__ARM_ARCH_%s__", arm_selected_cpu->arch); + sprintf (arm_arch_name, "__ARM_ARCH_%s__", arm_active_target.arch_pp_name); insn_flags = arm_selected_cpu->flags; - arm_base_arch = arm_selected_cpu->base_arch; + arm_base_arch = arm_active_target.base_arch; arm_tune = arm_active_target.tune_core; tune_flags = arm_active_target.tune_flags; @@ -26012,12 +26012,13 @@ arm_file_start (void) arm_active_target.arch_name); } } - else if (strncmp (arm_selected_cpu->name, "generic", 7) == 0) - asm_fprintf (asm_out_file, "\t.arch %s\n", arm_selected_cpu->name + 8); + else if (strncmp (arm_active_target.core_name, "generic", 7) == 0) + asm_fprintf (asm_out_file, "\t.arch %s\n", + arm_active_target.core_name + 8); else { const char* truncated_name - = arm_rewrite_selected_cpu (arm_selected_cpu->name); + = arm_rewrite_selected_cpu (arm_active_target.core_name); asm_fprintf (asm_out_file, "\t.cpu %s\n", truncated_name); } --------------74255048B07DB6BC0CACF604--