From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 57285 invoked by alias); 10 Aug 2017 13:38:02 -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 57218 invoked by uid 89); 10 Aug 2017 13:38:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=unaffected, H*p:D*org X-HELO: mail-wr0-f172.google.com Received: from mail-wr0-f172.google.com (HELO mail-wr0-f172.google.com) (209.85.128.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 10 Aug 2017 13:37:59 +0000 Received: by mail-wr0-f172.google.com with SMTP id f21so3088601wrf.5 for ; Thu, 10 Aug 2017 06:37:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:mail-followup-to:subject:date:message-id :user-agent:mime-version; bh=SEmzoRk9xe0VMgecBhh+Wzd9/OTNion0nmMIKaARzZs=; b=XmLh8x2pMC3eFOxuqcVRR57VkUyaSLWvpapQqnAyEz0Op6eZnv9b1+hGXtQfeVjbkP nR/JCvWIBzTDqDhoOKDPjWS4ph75beNz6S+f5wQWHgIaHTqJ6nLvKK+lFpGxF73asq9c Nkp5T2AsgXfr9c1xIpCquxHCYLH7whqnayOSpJnKJF9rtjCpE6Y+v4QNutdzxAKKHA6O 4cUIJBOOfBYq2WSpx8AMFTigj5rgQv0rwY86BeH3w0SmsWTO+kEQiuoaF5y9AitSnlcV HIVtTcTQ7uEDdmhU+yYjzDgMU1ws+ApwXqq55WMqYdKPDb5xcOdXmG+dnkEirjzGoSyy A0dw== X-Gm-Message-State: AHYfb5hJprGnw7FhzCZT1c04rsXN4tMBt2cXrrTxjWDCR+mdwQHELvvD vCNxBjQ65x1D/Z59BWJ4Lw== X-Received: by 10.223.160.68 with SMTP id l4mr8038807wrl.162.1502372277076; Thu, 10 Aug 2017 06:37:57 -0700 (PDT) Received: from localhost ([2.26.27.176]) by smtp.gmail.com with ESMTPSA id n22sm4414695wra.30.2017.08.10.06.37.55 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 Aug 2017 06:37:56 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: PR81738: Split vect-alias-check-6.c Date: Thu, 10 Aug 2017 13:42:00 -0000 Message-ID: <87y3qrv8zw.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2017-08/txt/msg00741.txt.bz2 The second loop in the testcase only vectorises if we can reverse a vector and if aligned loads aren't required. Sanity-checked on aarch64-linux-gnu, x86_64-linux-gnu and powerpc64le-linux-gnu (although all three were unaffected). OK to install? Thanks, Richard 2017-08-10 Richard Sandiford gcc/testsuite/ PR testsuite/81738 * gcc.dg/vect/vect-alias-check-6.c: Move second function to... * gcc.dg/vect/vect-alias-check-7.c: ...this new file. Require vect_perm and vect_element_align for vectorization. Index: gcc/testsuite/gcc.dg/vect/vect-alias-check-6.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-alias-check-6.c 2017-08-04 11:40:26.372205514 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-alias-check-6.c 2017-08-10 14:36:24.201888108 +0100 @@ -12,12 +12,5 @@ f1 (struct s *a, struct s *b) a->x[i + 1] += b->x[i]; } -void -f2 (struct s *a, struct s *b) -{ - for (int i = 0; i < N; ++i) - a->x[i] += b->x[N - i - 1]; -} - -/* { dg-final { scan-tree-dump-times {checking that [^\n]* and [^\n]* have different addresses} 2 "vect" } } */ -/* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 2 "vect" } } */ +/* { dg-final { scan-tree-dump {checking that [^\n]* and [^\n]* have different addresses} "vect" } } */ +/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */ Index: gcc/testsuite/gcc.dg/vect/vect-alias-check-7.c =================================================================== --- /dev/null 2017-08-09 18:16:39.535015779 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-alias-check-7.c 2017-08-10 14:36:24.201888108 +0100 @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target vect_int } */ + +#define N 16 + +struct s { int x[N]; }; + +void +f1 (struct s *a, struct s *b) +{ + for (int i = 0; i < N; ++i) + a->x[i] += b->x[N - i - 1]; +} + +/* { dg-final { scan-tree-dump {checking that [^\n]* and [^\n]* have different addresses} "vect" } } */ +/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { target { vect_perm && vect_element_align } } } } */