From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22440 invoked by alias); 12 Nov 2015 11:24:28 -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 22426 invoked by uid 89); 12 Nov 2015 11:24:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-yk0-f174.google.com Received: from mail-yk0-f174.google.com (HELO mail-yk0-f174.google.com) (209.85.160.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 12 Nov 2015 11:24:26 +0000 Received: by ykfs79 with SMTP id s79so91189394ykf.1 for ; Thu, 12 Nov 2015 03:24:24 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.129.46.212 with SMTP id u203mr15484206ywu.147.1447327464596; Thu, 12 Nov 2015 03:24:24 -0800 (PST) Received: by 10.37.93.11 with HTTP; Thu, 12 Nov 2015 03:24:24 -0800 (PST) In-Reply-To: <20151112095728.GA51435@msticlxl57.ims.intel.com> References: <20151112095728.GA51435@msticlxl57.ims.intel.com> Date: Thu, 12 Nov 2015 11:24:00 -0000 Message-ID: Subject: Re: [PATCH, PR68286] Fix vector comparison expand From: Richard Biener To: Ilya Enkovich Cc: GCC Patches Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg01487.txt.bz2 On Thu, Nov 12, 2015 at 10:57 AM, Ilya Enkovich wr= ote: > Hi, > > My vector comparison patches broken expand of vector comparison on target= s which don't have new comparison patterns but support VEC_COND_EXPR. This= happens because it's not checked vector comparison may be expanded as a co= mparison. This patch fixes it. Bootstrapped and regtested on powerpc64le-= unknown-linux-gnu. OK for trunk? Ok. Thanks, Richard. > Thanks, > Ilya > -- > gcc/ > > 2015-11-12 Ilya Enkovich > > * expr.c (do_store_flag): Expand vector comparison as > VEC_COND_EXPR if vector comparison is not supported > by target. > > gcc/testsuite/ > > 2015-11-12 Ilya Enkovich > > * gcc.dg/pr68286.c: New test. > > > diff --git a/gcc/expr.c b/gcc/expr.c > index 03936ee..bd43dc4 100644 > --- a/gcc/expr.c > +++ b/gcc/expr.c > @@ -11128,7 +11128,8 @@ do_store_flag (sepops ops, rtx target, machine_mo= de mode) > if (TREE_CODE (ops->type) =3D=3D VECTOR_TYPE) > { > tree ifexp =3D build2 (ops->code, ops->type, arg0, arg1); > - if (VECTOR_BOOLEAN_TYPE_P (ops->type)) > + if (VECTOR_BOOLEAN_TYPE_P (ops->type) > + && expand_vec_cmp_expr_p (TREE_TYPE (arg0), ops->type)) > return expand_vec_cmp_expr (ops->type, ifexp, target); > else > { > diff --git a/gcc/testsuite/gcc.dg/pr68286.c b/gcc/testsuite/gcc.dg/pr6828= 6.c > new file mode 100644 > index 0000000..d0392e8 > --- /dev/null > +++ b/gcc/testsuite/gcc.dg/pr68286.c > @@ -0,0 +1,17 @@ > +/* PR target/68286 */ > +/* { dg-do compile } */ > +/* { dg-options "-O3" } */ > + > +int a, b, c; > +int fn1 () > +{ > + int d[] =3D {0}; > + for (; c; c++) > + { > + float e =3D c; > + if (e) > + d[0]++; > + } > + b =3D d[0]; > + return a; > +}