From patchwork Fri Oct 23 11:12:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Enkovich X-Patchwork-Id: 534924 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 7C439141331 for ; Fri, 23 Oct 2015 22:13:17 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=FKB+x0qr; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; q=dns; s=default; b=TsW2p+QgY6mIDtAZH ktQ610R2J+AMnQ3ZC27rWpHU0o//hN5iz88oEHt1AAdHi54C06Li79iV0P7g+z1F aIXnYnV2gnBUTkx8Y13qcVWfzHUEMg6tO42aBlnPuMIYgFjrMc6DA1O83CmiNAU4 Z7aE/hgrS5QBd48RwlLfGbIuac= 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:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=default; bh=PGFPZQotAbasGwx8FuIS+Je awP0=; b=FKB+x0qrnGQBDUuu8OZNuemcWLjjbqRohwX/C3nIrKZcP5MWXHtoJIj 6dSs3ZCuvuXIUgOC7aFFe1gdP3pWQWnFfKncJYts4Y+4DylU3iH671I1Utlgk+2Z G20CAmKbggPPq29URZ9ewcBELJFxTVu7cP964CpfrapOOuakrJjU= Received: (qmail 39182 invoked by alias); 23 Oct 2015 11:13:10 -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 39154 invoked by uid 89); 23 Oct 2015 11:13:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f180.google.com Received: from mail-wi0-f180.google.com (HELO mail-wi0-f180.google.com) (209.85.212.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 23 Oct 2015 11:13:08 +0000 Received: by wicfv8 with SMTP id fv8so27025743wic.0 for ; Fri, 23 Oct 2015 04:13:05 -0700 (PDT) X-Received: by 10.194.185.211 with SMTP id fe19mr3875170wjc.80.1445598785707; Fri, 23 Oct 2015 04:13:05 -0700 (PDT) Received: from msticlxl57.ims.intel.com (jfdmzpr02-ext.jf.intel.com. [134.134.137.71]) by smtp.gmail.com with ESMTPSA id e63sm346803wma.7.2015.10.23.04.13.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Oct 2015 04:13:04 -0700 (PDT) Date: Fri, 23 Oct 2015 14:12:40 +0300 From: Ilya Enkovich To: Richard Biener Cc: Andreas Schwab , gcc-patches , Jeff Law Subject: Re: [Boolean Vector, patch 1/5] Introduce boolean vector to be used as a vector comparison type Message-ID: <20151023111240.GC23452@msticlxl57.ims.intel.com> References: <20151002135921.GE26618@msticlxl57.ims.intel.com> <20151022162105.GB23452@msticlxl57.ims.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes On 23 Oct 11:40, Richard Biener wrote: > On Thu, Oct 22, 2015 at 6:21 PM, Ilya Enkovich wrote: > > On 22 Oct 12:37, Andreas Schwab wrote: > >> Ilya Enkovich writes: > >> > >> > 2015-10-22 13:13 GMT+03:00 Andreas Schwab : > >> >> FAIL: gcc.c-torture/compile/pr54713-1.c -O0 (internal compiler error) > >> > > >> > Can't reproduce it on i386. What's config used? > >> > >> http://gcc.gnu.org/ml/gcc-testresults/2015-10/msg02350.html > >> http://gcc.gnu.org/ml/gcc-testresults/2015-10/msg02361.html > >> http://gcc.gnu.org/ml/gcc-testresults/2015-10/msg02396.html > >> > >> Andreas. > >> > >> -- > >> Andreas Schwab, SUSE Labs, schwab@suse.de > >> GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 > >> "And now for something completely different." > > > > Thanks! > > The problem is in wrong mboolean vector size in case target cannot provide a mode for it. I tested it on i386 with vector extension switched off, but with extensions off vector modes still exist, thus I missed this case. Here is a patch to fix it. Bootstrapped and regtested on powerpc64le-unknown-linux-gnu. I see disappeared fails: > > > > gcc.c-torture/compile/pr54713-2.c -O0 (test for excess errors) > > gcc.c-torture/compile/pr54713-3.c -O0 (test for excess errors) > > > > I believe other targets should be fixed as well. > > > > Thanks, > > Ilya > > -- > > gcc/ > > > > 2015-10-22 Ilya Enkovich > > > > * tree.c (build_truth_vector_type): Support BLK mode > > returned for boolean vector. > > > > > > diff --git a/gcc/tree.c b/gcc/tree.c > > index 7d10dd6..836b69a 100644 > > --- a/gcc/tree.c > > +++ b/gcc/tree.c > > @@ -10654,8 +10654,12 @@ build_truth_vector_type (unsigned nunits, unsigned vector_size) > > > > gcc_assert (mask_mode != VOIDmode); > > > > - unsigned HOST_WIDE_INT esize = GET_MODE_BITSIZE (mask_mode) / nunits; > > - gcc_assert (esize * nunits == GET_MODE_BITSIZE (mask_mode)); > > + unsigned HOST_WIDE_INT vsize = GET_MODE_BITSIZE (mask_mode); > > + if (!vsize) > > This should better check for mask_mode == BLKmode instead? Here is a version with BLKmode check. I bootstrapped it on powerpc64le-unknown-linux-gnu (c,c++,fotran only) and checked pr54713-2.c, pr54713-3.c are fixed by this patch. Is it OK for trunk? Thanks, Ilya --- gcc/ 2015-10-23 Ilya Enkovich PR middle-end/68066 * tree.c (build_truth_vector_type): Support BLK mode returned for boolean vector. diff --git a/gcc/tree.c b/gcc/tree.c index 09df67e..79bbd07 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -10671,8 +10671,14 @@ build_truth_vector_type (unsigned nunits, unsigned vector_size) gcc_assert (mask_mode != VOIDmode); - unsigned HOST_WIDE_INT esize = GET_MODE_BITSIZE (mask_mode) / nunits; - gcc_assert (esize * nunits == GET_MODE_BITSIZE (mask_mode)); + unsigned HOST_WIDE_INT vsize; + if (mask_mode == BLKmode) + vsize = vector_size * BITS_PER_UNIT; + else + vsize = GET_MODE_BITSIZE (mask_mode); + + unsigned HOST_WIDE_INT esize = vsize / nunits; + gcc_assert (esize * nunits == vsize); tree bool_type = build_nonstandard_boolean_type (esize);