From patchwork Fri Nov 3 16:14:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 833977 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-465870-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="OkQWo1T6"; dkim-atps=neutral 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 3yT6Xj1B4tz9sBd for ; Sat, 4 Nov 2017 03:16:52 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:date:message-id:cc:from:to; q=dns; s=default; b=pqMBDIz 0JPP0Xko67bLJMXlhTTcmb7e51Qb29u+5Pd98tf2ztzc6Sfr6AK1/FH0q9g5XWz/ Mw++J83MTqPfHBHYZpXkvwxmnf6I4eHV0vK40ts7qEJEUJSLLSbu5ROxKrluwsrs 2jOLVjaKgCFG0b7TZ4x9ffKmgAKmy2iD7YGk= 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:date:message-id:cc:from:to; s=default; bh=CAhRw9rT9SQ2+ +TACdzW9qhVXGw=; b=OkQWo1T6HKa51D/Uw9CsXTiLmo+SEM2tl9lXeKIrP9JBe rbFEnObr7Hx5sWr+b0Iizdm0ZKlzCM46toSruCeccZK/20steueueJ/ZNR1rm+nG Psiv6rv0BWvviHXttpWOZaPDJhs4YFr/gLY0lgehzP4Whg/rGCB2TZ5WcjjY1Q= Received: (qmail 98786 invoked by alias); 3 Nov 2017 16:16:41 -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 98116 invoked by uid 89); 3 Nov 2017 16:16:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-pf0-f172.google.com Received: from mail-pf0-f172.google.com (HELO mail-pf0-f172.google.com) (209.85.192.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 03 Nov 2017 16:16:40 +0000 Received: by mail-pf0-f172.google.com with SMTP id n89so2528566pfk.11 for ; Fri, 03 Nov 2017 09:16:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:date:message-id:cc:from:to; bh=CzZ7QSxi8yK6jBKyQTS3WRLjBMYsk/P0dVkYS+HxKzU=; b=KWMdpklyGHrgv2RTVrTVsr+5sWDhMSHMcWO3cT0uq5dxHS6B7TpP2URBjuSU0PQHa9 /7qOSiwtElJrTBNl5f5t1KW3vk8nhM2F9DMJMM+UzbxjNOT31Mqb2xlzEVeKyzLzbtyo 8K71zGJ10gg4go+miXmf6n9nckTNlyRoEmHyd+QgehYwaKmj9ouvz703GFBV2/zhiUrh EzMJhRAMr+u/HDHQFJSLEhRBZykE4Qs7ySG4rx2ZcI1H0D/lpNOQ0xhbC+bzHLjKOdAc 0DafKwUuZfrmU+V+5fjVlqzIjSI/DL9J1PKUNBdlHSYVIvb1MCogVYLik7HZ30unCwAV 1cWA== X-Gm-Message-State: AMCzsaXK5ZJ9PRbxkZbQ4TbkM9DDnP4dxY4DjgbS2DuDjw97WjK5G4LR x9I8+lHFBrEucRC+2juRATkAoQ== X-Google-Smtp-Source: ABhQp+QnUhFqyqPhJFh1MtLtJhHSWtiOW22+48wHC9/ivMMO4FGDZquSNGxrqLrPcvu4Jq30VR/ukw== X-Received: by 10.98.213.194 with SMTP id d185mr8319806pfg.107.1509725798327; Fri, 03 Nov 2017 09:16:38 -0700 (PDT) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id t81sm11668542pfg.187.2017.11.03.09.16.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Nov 2017 09:16:37 -0700 (PDT) Subject: [PATCH] RISC-V: If -m[no-]strict-align is not passed, assume its value from -mtune Date: Fri, 3 Nov 2017 09:14:10 -0700 Message-Id: <20171103161410.4807-1-palmer@dabbelt.com> Cc: patches@groups.riscv.org, Andrew Waterman From: Palmer Dabbelt To: gcc-patches@gcc.gnu.org X-IsSubscribed: yes From: Andrew Waterman 2017-11-03 Andrew Waterman * config/riscv/riscv.c (riscv_option_override): Conditionally set TARGET_STRICT_ALIGN based upon -mtune argument. --- gcc/config/riscv/riscv.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gcc/config/riscv/riscv.c b/gcc/config/riscv/riscv.c index b81a2d29fbfd..f0b05d7eaeda 100644 --- a/gcc/config/riscv/riscv.c +++ b/gcc/config/riscv/riscv.c @@ -3772,9 +3772,13 @@ riscv_option_override (void) /* Use -mtune's setting for slow_unaligned_access, even when optimizing for size. For architectures that trap and emulate unaligned accesses, - the performance cost is too great, even for -Os. */ - riscv_slow_unaligned_access_p = (cpu->tune_info->slow_unaligned_access - || TARGET_STRICT_ALIGN); + the performance cost is too great, even for -Os. Similarly, if + -m[no-]strict-align is left unspecified, heed -mtune's advice. */ + riscv_slow_unaligned_access = (cpu->tune_info->slow_unaligned_access + || TARGET_STRICT_ALIGN); + if ((target_flags_explicit & MASK_STRICT_ALIGN) == 0 + && cpu->tune_info->slow_unaligned_access) + target_flags |= MASK_STRICT_ALIGN; /* If the user hasn't specified a branch cost, use the processor's default. */