From patchwork Thu Jul 24 12:27:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marat Zakirov X-Patchwork-Id: 373396 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 D4E651401EC for ; Thu, 24 Jul 2014 22:27:29 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; q=dns; s=default; b=uwAkLJEgtQXvcvsyv 5Xqqm5qNXSABEPyOBupC5aYBCVqssSn9Vv+INs8ROwjwBY0EJH8EeF9ryv9MphqM LhhE8NcMkCavGUvq9V6khqTEnDj5b982iHRVlGQR//rQIlI6SxN3Bzs2PcQl9s6C HDBIuyD1GDdkli8xPriXWPH4bE= 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 :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; s=default; bh=u1YmvKCOTZHqu4eaO2Aeb4/ Wg/0=; b=pUA8tXjPxY1CqZHbQqk8ls+7AIeQ3485qxZp6ss/s5bdLf6wdYOZiqO uD7q2Ew8BswAqWnZyUs+lYX15CwXCQ1AZqg9W6ZZx2UczLllDpNcPt3+MqN6s6es oLCmic44uO14K6eaYeT39F9WOL9K88mhaZpjlvfHHOHWnOlRBGZ0= Received: (qmail 11489 invoked by alias); 24 Jul 2014 12:27:22 -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 11478 invoked by uid 89); 24 Jul 2014 12:27:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mailout4.w1.samsung.com Received: from mailout4.w1.samsung.com (HELO mailout4.w1.samsung.com) (210.118.77.14) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (DES-CBC3-SHA encrypted) ESMTPS; Thu, 24 Jul 2014 12:27:17 +0000 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N97006LAUL46I20@mailout4.w1.samsung.com> for gcc-patches@gcc.gnu.org; Thu, 24 Jul 2014 13:27:04 +0100 (BST) Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 91.AA.19257.1ABF0D35; Thu, 24 Jul 2014 13:27:13 +0100 (BST) Received: from [106.109.129.103] by eusync3.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0N9700KVLULCE330@eusync3.samsung.com>; Thu, 24 Jul 2014 13:27:13 +0100 (BST) Message-id: <53D0FBA1.9080607@samsung.com> Date: Thu, 24 Jul 2014 16:27:13 +0400 From: Marat Zakirov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-version: 1.0 To: "gcc-patches@gcc.gnu.org" Cc: Richard Biener , Cong Hou , Yury Gribov Subject: [PATCHv2] Fix vector tests on ARM platforms with disabled unaligned accesses References: <53CFC558.3020202@samsung.com> In-reply-to: <53CFC558.3020202@samsung.com> Content-type: multipart/mixed; boundary=------------020901060303010208080702 On 07/23/2014 06:23 PM, Marat Zakirov wrote: > Hi there! > > I made a patch which fixes regressions on ARM platforms with disabled > unaligned accesses. The problem is that 'arm_vect_no_misalign' > predicate do not check 'unaligned_access' global variable to determine > whether unaligned access to vector are allowed. This leads to spurious > vect.exp test fails when GCC is configured > --with-specs=%{!munaligned-access:-mno-unaligned-access}. > > Attached patch fixes ARM predicate and several tests to correctly > handle the issue. > > The following targets were reg. tested for multiple targets (ARM, > Thumb-1, Thumb-2, x86, x86_64) with and without > -mno-unaligned-access. Analysis showed patch affects only vect.exp > tests so only vect.exp was tested. > > For x86, x86_64, ARM without -mno-unaligned-access, Thumb-2 without > -mno-unaligned-access and Thumb-1 no regressions occured. For > ARM/Thumb2 with -mno-unaligned-access patch fixed most of failures but > triggered some problems (see attached log) for current vect.exp tests: > 1) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61887 > 2) Some XPASS'es due to unexpected loop versioning (e.g. > gcc.dg/vect/pr33804.c). > 3) After predicate fix some passing tests which require unaligned > vector support become NA (this was expected). > Here is new version of patch and regression log. On the current trunk results are slightly different due to patches for Richard Biener (no UNRESOLVED fails) but some PASS->XPASS regressions still remain (see attachment): PASS->XPASS: gcc.dg/vect/if-cvt-stores-vect-ifcvt-18.c scan-tree-dump-times vect "vectorized 1 loops" 1 PASS->XPASS: gcc.dg/vect/pr33804.c -flto -ffat-lto-objects scan-tree-dump-times vect "vectorized 1 loops" 1 etc. These XPASS'es are due to code versioning: current GCC creates 2 versions of loop: aligned and misaligned. It's look like they are slightly out of date at lest for ARM. gcc/testsuite/ChangeLog: 2014-07-23 Marat Zakirov * gcc.dg/vect/vect-109.c: Skip predicate added. * gcc.dg/vect/vect-93.c: Test check fixed. * gcc.dg/vect/bb-slp-10.c: Likewise. * lib/target-supports.exp (check_effective_target_arm_vect_no_misalign): Check unaligned feature. diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-10.c b/gcc/testsuite/gcc.dg/vect/bb-slp-10.c index a1850ed..0090a4b 100644 --- a/gcc/testsuite/gcc.dg/vect/bb-slp-10.c +++ b/gcc/testsuite/gcc.dg/vect/bb-slp-10.c @@ -49,7 +49,7 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "unsupported alignment in basic block." 1 "slp2" { xfail vect_element_align } } } */ +/* { dg-final { scan-tree-dump "unsupported alignment in basic block." 1 "slp2" { xfail vect_element_align } } } */ /* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp2" { target vect_element_align } } } */ /* { dg-final { cleanup-tree-dump "slp2" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-109.c b/gcc/testsuite/gcc.dg/vect/vect-109.c index 854c970..c671175 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-109.c +++ b/gcc/testsuite/gcc.dg/vect/vect-109.c @@ -1,3 +1,4 @@ +/* { dg-skip-if "" { vect_no_align } } */ /* { dg-require-effective-target vect_int } */ #include diff --git a/gcc/testsuite/gcc.dg/vect/vect-93.c b/gcc/testsuite/gcc.dg/vect/vect-93.c index 65403eb..1065a6e 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-93.c +++ b/gcc/testsuite/gcc.dg/vect/vect-93.c @@ -79,7 +79,7 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target vect_no_align } } } */ /* in main: */ -/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target vect_no_align } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_no_align } } } */ /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align } } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index db65ebe..42251e8 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -2293,7 +2293,8 @@ proc check_effective_target_arm_little_endian { } { proc check_effective_target_arm_vect_no_misalign { } { return [check_no_compiler_messages arm_vect_no_misalign assembly { #if !defined(__arm__) \ - || (defined(__ARMEL__) \ + || (defined(__ARM_FEATURE_UNALIGNED) \ + && defined(__ARMEL__) \ && (!defined(__thumb__) || defined(__thumb2__))) #error FOO #endif