From patchwork Thu Jun 29 10:26:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Richard Earnshaw (lists)" X-Patchwork-Id: 782146 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 3wywns6vNCz9s75 for ; Thu, 29 Jun 2017 20:27:09 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="q0Ffgg/A"; 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 :subject:from:to:references:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=iyULK1jsOLkfnXDsG V4XDLHDWy7sdLz82MKs/T/QP+BlhLEs0KwJWk6y1C5WXvLNcICTS/jfCsplPIlPb 7wMmcgJR8jEdSx83NEetJhItvAFrZy1jpdH+tUdQn/lc/g0bzHzrAzPROCsvcKJ7 fyis78qSS8dF+f810Z57xujLPI= 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 :subject:from:to:references:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=RFJ/NY/KlHwDkWjDRKTuiMp EV5A=; b=q0Ffgg/AD/Fmvx6MUTdeRwoID6rhRsyaYUJqZvVtKqyHnsVuDqEXFpZ lD7nuI/l9uGx7BPPbO8xt2eS1nI9KaDwvJqIaq5xGcywRJJUGgjFsdB4zs90RGix eII1a/mr1MFf9m87mZNX6u4QIRi42axi6gCM58G76MT5R2cVb81o= Received: (qmail 76544 invoked by alias); 29 Jun 2017 10: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 74749 invoked by uid 89); 29 Jun 2017 10:26:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_SORBS_SPAM, 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, 29 Jun 2017 10:26:56 +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 F06A82B; Thu, 29 Jun 2017 03:26:54 -0700 (PDT) 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 7F2763F581; Thu, 29 Jun 2017 03:26:54 -0700 (PDT) Subject: Re: [arm] Fix incorrect __ARM_ARCH_PROFILE for -march=armv7 From: "Richard Earnshaw (lists)" To: gcc-patches References: <8cdfcc0f-db78-6013-bcb8-d9cc1afc0dce@arm.com> Message-ID: <413e58f6-ceb9-8172-3d8e-6b9ba43acdc1@arm.com> Date: Thu, 29 Jun 2017 11:26:51 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <8cdfcc0f-db78-6013-bcb8-d9cc1afc0dce@arm.com> On 28/06/17 16:05, Richard Earnshaw (lists) wrote: > ACLE explicitly states that when targetting the common subset of > ARMv7-A, ARMv7-R and ARMv7-M, the __ARM_ARCH_PROFILE macro should not be > set. We currently set it to 'M' which is clearly erroneous. > > The logic for creating this is very convoluted and also somewhat > fragile, so I've taken the opportunity to use the new CPU and > architecture definition infrastructure to record the profile for each > architecture explicitly rather than try to reconstruct it from other > data. I think this results in a much more robust solution. > > > 2017-06-28 Richard Earnshaw > > * config/arm/parsecpu.awk (profile): Parse new keyword in an arch > context. > (gen_comm_data): Emit architectural setting of arch_prof. > * config/arm/arm-cpus.in (armv6-m, armv6s-m, armv7-a, armv7ve): Set the > profile. > (armv7-r, armv7-m, armv7e-m, armv8-a, armv8.1-a, armv8.2-a): Likewise. > (armv8-m.base, armv8-m.main): Likewise. > * arm-protos.h (arm_build_target): Add profile field. > (arch_option): Likewise. > * config/arm/arm.c (arm_configure_build_target): Copy the profile to > the active target. > * config/arm/arm.h (TARGET_ARM_ARCH_PROFILE): Use > arm_active_target.profile. > > > Committed. My patch yesterday accidentally missed a hunk that added the update to the tail entry of the autogenerated data structure produced by parsecpu.awk. This causes native bootstraps to fail. This patch adds back the missing hunk. 2017-06-29 Richard Earnshaw * config/arm/parsecpu.awk (gen_comm_data): Add initializer for profile to the dummy entry at the end of the list of architectures. * config/arm/arm-cpu-cdata.h: Regenerated. diff --git a/gcc/config/arm/arm-cpu-cdata.h b/gcc/config/arm/arm-cpu-cdata.h index 4528d07..1cf1149 100644 --- a/gcc/config/arm/arm-cpu-cdata.h +++ b/gcc/config/arm/arm-cpu-cdata.h @@ -2462,7 +2462,7 @@ const arch_option all_architectures[] = TARGET_CPU_iwmmxt2, }, {{NULL, NULL, {isa_nobit}}, - NULL, BASE_ARCH_0, TARGET_CPU_arm_none} + NULL, BASE_ARCH_0, 0, TARGET_CPU_arm_none} }; const arm_fpu_desc all_fpus[] = diff --git a/gcc/config/arm/parsecpu.awk b/gcc/config/arm/parsecpu.awk index d38d664..d096bca 100644 --- a/gcc/config/arm/parsecpu.awk +++ b/gcc/config/arm/parsecpu.awk @@ -311,7 +311,7 @@ function gen_comm_data () { } print " {{NULL, NULL, {isa_nobit}}," - print " NULL, BASE_ARCH_0, TARGET_CPU_arm_none}" + print " NULL, BASE_ARCH_0, 0, TARGET_CPU_arm_none}" print "};\n" print "const arm_fpu_desc all_fpus[] ="