From patchwork Tue Apr 11 15:00:01 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: 97274 Delivered-To: patch@linaro.org Received: by 10.182.246.10 with SMTP id xs10csp1829669obc; Tue, 11 Apr 2017 08:01:15 -0700 (PDT) X-Received: by 10.99.123.75 with SMTP id k11mr61410911pgn.150.1491922875581; Tue, 11 Apr 2017 08:01:15 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id t29si9216434pfk.157.2017.04.11.08.01.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Apr 2017 08:01:15 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-451431-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-451431-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-451431-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=q/bZIPf3AQ+Cz71vJhDGefl9KdDurWQMzm0r9I/03DdPfGjeqp fDMCygGYuq22X9wWdJ1pabMMJw7bZPud/4R7f54oemBrmvopc4eto8tkZA6Yy4ej FPfJByCb05KI7su95RRTLO3ZZV7jpWd7eiwf6ocTV0Vc/PcsdZYvENKMY= 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=J433Buw+VGoQaBgYZYgfdDcCZ0s=; b=Um74i6j8TTc13XdZsoi4 9IADju6B/QZvTlXYWxnVqfVNm/of5OfV8SKEmniGXpx4UmVo2hlafOXw2mcRZU4B VsW2AWqZYr+MVV8BA7Bj/kiDTg5ztgpqGvejRIvbgkGW0J9OK5Y4/LVdlOCGQytY Gy2IS9yHAxg2Tv+lYgS31CQ= Received: (qmail 83327 invoked by alias); 11 Apr 2017 15:00:44 -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 66282 invoked by uid 89); 11 Apr 2017 15:00:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=essentially 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; Tue, 11 Apr 2017 15:00:04 +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 10B32CFC for ; Tue, 11 Apr 2017 08:00:04 -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 92ADC3F575; Tue, 11 Apr 2017 08:00:03 -0700 (PDT) To: gcc-patches From: "Richard Earnshaw (lists)" Subject: [arm] PR 80389 - if architecture and cpu mismatch, don't print an architecture name as a CPU name Message-ID: <5cc6d019-3f5c-8db2-ade5-5a1e4cba1560@arm.com> Date: Tue, 11 Apr 2017 16:00:01 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In this PR we incorrectly print the architecture name in a .cpu directive in the assembly file when the -mcpu and -march options conflict (don't target the same base architecture). In this case the .arch overrides the .cpu directive and we should emit a .arch option. Fixed thusly. PR target/80389 * config/arm/arm.c (arm_configure_build_target): When -mcpu and -arch conflict, set target->arch_name instead of target->cpu_name. Tested on a cross compiler with no problems. I'm doing a full bootstrap as well, but that's very unlikely to hit this scenario, so committed anyway. R. diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 511e163..f04deed 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -3098,15 +3098,15 @@ arm_configure_build_target (struct arm_build_target *target, arm_selected_tune = arm_selected_cpu; arm_selected_cpu = arm_selected_arch; + target->arch_name = arm_selected_arch->name; } else { /* Architecture and CPU are essentially the same. Prefer the CPU setting. */ arm_selected_arch = NULL; + target->core_name = arm_selected_cpu->name; } - - target->core_name = arm_selected_cpu->name; } else {