From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 40719 invoked by alias); 29 Nov 2017 08:19:01 -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 40689 invoked by uid 89); 29 Nov 2017 08:19:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.7 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,KB_WAM_FROM_NAME_SINGLEWORD,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 29 Nov 2017 08:18:59 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CD7838553E; Wed, 29 Nov 2017 08:18:57 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-77.ams2.redhat.com [10.36.116.77]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 69BFC5C888; Wed, 29 Nov 2017 08:18:57 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id vAT8IrWr022388; Wed, 29 Nov 2017 09:18:54 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id vAT8IpGm022387; Wed, 29 Nov 2017 09:18:51 +0100 Date: Wed, 29 Nov 2017 08:30:00 -0000 From: Jakub Jelinek To: Rainer Orth , Mike Stump , Kyrill Tkachov Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix PR tree-optimization/83195 testcase for arm Message-ID: <20171129081851.GV2353@tucnak> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.7.1 (2016-10-04) X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg02474.txt.bz2 Hi! The pr82929.c testcase uses store_merge effective target, which is int32plus && nonstrict_align. Unfortunately, arm is handled for nonstrict_align wierdly, although it has STRICT_ALIGNMENT 1, it is sometimes considered nonstrict_align (the only exception apparently). Now, the testcase really needs a non-strict alignment target where STRICT_ALIGNMENT is 0, otherwise the optimization it tests is not beneficial. So, the following patch stops testing it on arm, and adds another test where the pointers are guaranteed to be aligned and thus we can test for the optimization even on non-strict alignment targets. Bootstrapped/regtested on x86_64-linux and i686-linux, tested by hand using a cross-compiler to arm, ok for trunk? 2017-11-29 Jakub Jelinek PR tree-optimization/83195 * gcc.dg/pr82929.c: Don't check for "Merging successful" on arm. * gcc.dg/pr82929-2.c: New test. --- gcc/testsuite/gcc.dg/pr82929.c.jj 2017-11-10 15:42:39.000000000 +0100 +++ gcc/testsuite/gcc.dg/pr82929.c 2017-11-28 17:50:43.705221829 +0100 @@ -15,4 +15,4 @@ foo (short *p, short *q, short *r) p[1] = e & f; } -/* { dg-final { scan-tree-dump-times "Merging successful" 1 "store-merging" } } */ +/* { dg-final { scan-tree-dump-times "Merging successful" 1 "store-merging" { target { ! arm*-*-* } } } } */ --- gcc/testsuite/gcc.dg/pr82929-2.c.jj 2017-11-28 17:47:41.858409094 +0100 +++ gcc/testsuite/gcc.dg/pr82929-2.c 2017-11-28 17:48:55.264526160 +0100 @@ -0,0 +1,21 @@ +/* PR tree-optimization/82929 */ +/* { dg-do compile { target store_merge } } */ +/* { dg-options "-O2 -fdump-tree-store-merging" } */ + +void +foo (short *p, short *q, short *r) +{ + p = __builtin_assume_aligned (p, __alignof__ (int)); + q = __builtin_assume_aligned (q, __alignof__ (int)); + r = __builtin_assume_aligned (r, __alignof__ (int)); + short a = q[0]; + short b = q[1]; + short c = ~a; + short d = r[0]; + short e = r[1]; + short f = ~b; + p[0] = c & d; + p[1] = e & f; +} + +/* { dg-final { scan-tree-dump-times "Merging successful" 1 "store-merging" } } */ Jakub