From patchwork Wed Oct 4 13:35:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 114778 Delivered-To: patch@linaro.org Received: by 10.80.163.150 with SMTP id s22csp5963146edb; Wed, 4 Oct 2017 06:35:47 -0700 (PDT) X-Received: by 10.101.70.203 with SMTP id n11mr18591419pgr.197.1507124147077; Wed, 04 Oct 2017 06:35:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507124147; cv=none; d=google.com; s=arc-20160816; b=NyeHV5K8aoL44I+nBEQ7bx5b/v2U5sJhlpr5346RCu+TdDd99cJr44m7HAnnJON/F6 YYCHMmUMUhDmcn5Y93xVvs7/1RyttCNa1BHzt51xwN8U3sYlNokz2o7XYYGFaqYOQH/1 B5Dwyxh9vyHpl7QHQb/6jYaFoR16q+T0Q0SaEN9v0X+SmcU3tCLl5ONHu21aB8xPiR4C Sn+W6qVsSWlfIhKEmx2Pcd6eg2orGndowxMza8bjvmGvTfTR3moRJePkF2l10+eeeVyC y7y+WmjLJE6xXsoANAdSx9U9YLSQDKMATXwVde/Ji9dBmzpr14ewQaLt8f0nxVwmkbvW kc3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:mime-version:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=ZM/OVUxTZRhzPXCtWy9GsX75rGX+8vU6x7oUFut3PxQ=; b=gTrOwIRj/9v6MWLhuVj5zlRZaEm2hhrRrDgc3K1JCEAjHxO31Wtd8cPoW0HCU64zgX 53IXjS66aDSlH0Rna78SkRsUGuugHs6J4garL17AumVX1nW6T8X3R5Y6hY1q/kvwodyi 2c23R758NtCkqi/dZUMYxeoIfB1HaXI6nXB+Ou9PsdSwVRYUXTaHwIy1/iskgsZpOwkM wQ7LAxHW955SN5rxOnTTgxaIjCGm6bjKVXg55xvHFVx9NHNNl5Km4vHMkurhM37f97Ku mwvhevqsnt8biGXug4xk6Yqgz77fWmzc/lSFLoJ9Q6syUeE6UMvrk2t66tvyU/4gz76W wxPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=vGM/KwRa; spf=pass (google.com: domain of gcc-patches-return-463454-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-463454-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id p3si8682512pld.540.2017.10.04.06.35.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Oct 2017 06:35:47 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-463454-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 header.s=default header.b=vGM/KwRa; spf=pass (google.com: domain of gcc-patches-return-463454-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-463454-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=mjQszlLFEGIDnhuH3L4a7O1LNbAvnTTvR6Xmu2qf5Hs26/ C0yubzf+KNkhgbKHGCQxQDlQbErXJdmWcA2hCxl6F05+KUaDiWgs80/4nVzjkrzs L1bQzApk1/niQHe2bzA6ejGojPOFcpAaq/AfP9LeZD/+o2ky/ZwyUx5973qAk= 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 :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=UHso6iuzvGBYZs300Y9CLzqq9/U=; b=vGM/KwRaF+kUaQBCrwyD YwyTWMDL4cESEaVEc91GeRXzq1iFATwjK2mVSKL1nkQrp+lOIqV1knHylUR9dlmr lIBLq0oBdnYZNdu0IRcZUCpVHcZQ7pe1mvynhIgB70B8iqZR4dJtRpPLxBkDcbaV tbEqqgaUwEvhAscT6GGLiy4= Received: (qmail 19446 invoked by alias); 4 Oct 2017 13:35:34 -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 19427 invoked by uid 89); 4 Oct 2017 13:35:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.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=H*r:sk:mail-ua, Hx-spam-relays-external:sk:mail-ua, HX-HELO:sk:mail-ua, H*RU:sk:mail-ua X-HELO: mail-ua0-f175.google.com Received: from mail-ua0-f175.google.com (HELO mail-ua0-f175.google.com) (209.85.217.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 04 Oct 2017 13:35:32 +0000 Received: by mail-ua0-f175.google.com with SMTP id v12so7154648uaf.5 for ; Wed, 04 Oct 2017 06:35:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=LzGNsi/xAFt63WWYIY74hg6rvvy96IjkvM0Idqm/UMQ=; b=TWE2zYnwDcfMUfahz1IR5+wKPJNQyhmUuja3W2C2otYT/BlWxXeBQbGBZrmG2U0NL6 hv3/H29Z1eLfvxGEABkpb9GWcqrLgS6MyWjUxeah5AoadK6CDN01UzGqEHE2U1+GFv/R aYGIL++qYHuwa7TJDMNxIMH3p45+gWV/GAqYCniCRSF4KEYv//qGyXcp2hr0ZlqP4SKq JWQASjNZHocoSDQ5GliYLJrba5doYhMm8RlJUNWR2gwuYHy16MySBOESTNrKqTicpPNj K+beH2BKSNjKtsxDEIgr6YYI76YhG/64berm+o0Vya048tIRBW5CdSh4ReWKd/h0/I4N q+ew== X-Gm-Message-State: AMCzsaU0z2GqDQ+7dNQEFGdYSl+/5M2AI6ijNcJVQ7V3wQCOvqoPUDB8 jWB1t2M1IJ/TYC9Wu07+JrUrJEOeIXUaXtP6wUS8rsNgL8w= X-Google-Smtp-Source: AOwi7QDvWJ+Z97VWoPTszoR2HrbnuHUf91EQ6AAiMktdZLIacyAp58FBKz8pv39HY5vmd0e61YNORfOn+RamOCnkHUg= X-Received: by 10.176.4.71 with SMTP id 65mr6228760uav.82.1507124129896; Wed, 04 Oct 2017 06:35:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.120.3 with HTTP; Wed, 4 Oct 2017 06:35:29 -0700 (PDT) From: Christophe Lyon Date: Wed, 4 Oct 2017 15:35:29 +0200 Message-ID: Subject: [AArch64] Backport to gcc-7 PR71727 fix -mstrict-align To: "gcc-patches@gcc.gnu.org" X-IsSubscribed: yes Hi, I've recently committed a follow-up fix for PR71727 for -mstrict-align on aarch64 (r253242). I think it would be appropriate to apply it to gcc-7-branch. The patch from trunk applies cleanly to gcc-7-branch. Although the original bug was reported against 4.9.4, 5.3.1, 6.1.0, Naveen's patch was not backported to these branches, so it's not appropriate to backport my patch there. OK? Thanks, Christophe 2017-09-20 Christophe Lyon PR target/71727 gcc/ * config/aarch64/aarch64.c (aarch64_builtin_support_vector_misalignment): Always return false when misalignment is unknown. gcc/testsuite/ * gcc.target/aarch64/pr71727-2.c: New test. diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 799989a..7cc67ec 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -11757,19 +11757,9 @@ aarch64_builtin_support_vector_misalignment (machine_mode mode, if (optab_handler (movmisalign_optab, mode) == CODE_FOR_nothing) return false; + /* Misalignment factor is unknown at compile time. */ if (misalignment == -1) - { - /* Misalignment factor is unknown at compile time but we know - it's word aligned. */ - if (aarch64_simd_vector_alignment_reachable (type, is_packed)) - { - int element_size = TREE_INT_CST_LOW (TYPE_SIZE (type)); - - if (element_size != 64) - return true; - } - return false; - } + return false; } return default_builtin_support_vector_misalignment (mode, type, misalignment, is_packed); diff --git a/gcc/testsuite/gcc.target/aarch64/pr71727-2.c b/gcc/testsuite/gcc.target/aarch64/pr71727-2.c new file mode 100644 index 0000000..2bc803a --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/pr71727-2.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-mstrict-align -O3" } */ + +unsigned char foo(const unsigned char *buffer, unsigned int length) +{ + unsigned char sum; + unsigned int count; + + for (sum = 0, count = 0; count < length; count++) { + sum = (unsigned char) (sum + *(buffer + count)); + } + + return sum; +} + +/* { dg-final { scan-assembler-times "and\tw\[0-9\]+, w\[0-9\]+, 15" 1 } } */