From patchwork Mon Oct 26 09:35:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Enkovich X-Patchwork-Id: 535775 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 C356D140E4A for ; Mon, 26 Oct 2015 20:35:56 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=JG9l4l29; 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=s5tn5jzp7eu3thgpS /xkYLzvkiEcJIN77+g0jN0wSHOg5Fz3aZDrRSZKQdLWdFc7bRTQklcTGRnhuYUPW GCzZT5PC/3gWfJvPGAwn9m/l5a+W0nOmuMHNvum6OCJbforekwWCfuhTIZpH3AQk 9jlMcmkLt8q1Gtkt98vaCD2NvU= 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=h2CsEefk37GM/nZHLrgARwr uFjQ=; b=JG9l4l29V8w9doW7FnT7WgKGoGlaHesyVTLDQ5VeIJbaKJHxQGOzvJm vFbJj74/vglyMs2p8zq1l+x+cxeFtqlbWMWB7YRy/cZd0IKL2P4QwEPf+e58Lh4R Gn8NuEYNShYLnyEjab3P1pH/i2ujCnXahURLymc+DId8TrNymp78= Received: (qmail 61068 invoked by alias); 26 Oct 2015 09:35:47 -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 61056 invoked by uid 89); 26 Oct 2015 09:35:46 -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-io0-f171.google.com Received: from mail-io0-f171.google.com (HELO mail-io0-f171.google.com) (209.85.223.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 26 Oct 2015 09:35:45 +0000 Received: by iody8 with SMTP id y8so24385463iod.1 for ; Mon, 26 Oct 2015 02:35:43 -0700 (PDT) X-Received: by 10.107.47.24 with SMTP id j24mr18809082ioo.168.1445852143012; Mon, 26 Oct 2015 02:35:43 -0700 (PDT) Received: from msticlxl57.ims.intel.com (jfdmzpr01-ext.jf.intel.com. [134.134.139.70]) by smtp.gmail.com with ESMTPSA id cj4sm6164004igc.16.2015.10.26.02.35.40 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Oct 2015 02:35:42 -0700 (PDT) Date: Mon, 26 Oct 2015 12:35:12 +0300 From: Ilya Enkovich To: Richard Biener Cc: Jeff Law , gcc-patches Subject: Re: [PATCH, PR68062] Fix uniform vector operation lowering Message-ID: <20151026093512.GA20857@msticlxl57.ims.intel.com> References: <20151023152623.GD23452@msticlxl57.ims.intel.com> <562AA762.2030202@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes On 26 Oct 10:09, Richard Biener wrote: > On Sat, Oct 24, 2015 at 12:29 AM, Ilya Enkovich wrote: > > 2015-10-24 0:32 GMT+03:00 Jeff Law : > >> On 10/23/2015 09:26 AM, Ilya Enkovich wrote: > >>> > >>> Hi, > >>> > >>> This patch checks optab exists before using it vector vector statement > >>> lowering. It fixes compilation of test from PR68062 with -funsigned-char > >>> option added (doesn't fix original testcase). Bootstrapped for > >>> x86_64-unknown-linux-gnu. OK for trunk if no regressions? > >>> > >>> Thanks, > >>> Ilya > >>> -- > >>> gcc/ > >>> > >>> 2015-10-23 Ilya Enkovich > >>> > >>> * tree-vect-generic.c (expand_vector_operations_1): Check > >>> optab exists before use it. > >>> > >>> gcc/testsuite/ > >>> > >>> 2015-10-23 Ilya Enkovich > >>> > >>> * g++.dg/pr68062.C: New test. > >> > >> OK. > >> > >> Just curious, what was the tree code for which we couldn't find a suitable > >> optab? > > > > Those are various comparison codes. > > Yeah, sorry for missing that check. Btw, I was curious to see that we miss > a way to query from optab_tag the "kind" (normal, conversion, etc.) so code > can decide what optab_handler function to call (optab_handler or > convert_optab_handler). So the code I added errs on the "simplistic" side > and hopes that matching lhs and rhs1 type always gets us a non-convert optab... So probably better fix is ? Ilya > > Richard. > > > Ilya > > > >> > >> jeff > >> diff --git a/gcc/tree-vect-generic.c b/gcc/tree-vect-generic.c index d1fc0ba..73c5cc5 100644 --- a/gcc/tree-vect-generic.c +++ b/gcc/tree-vect-generic.c @@ -1533,7 +1533,8 @@ expand_vector_operations_1 (gimple_stmt_iterator *gsi) && TYPE_MODE (TREE_TYPE (type)) == TYPE_MODE (TREE_TYPE (srhs1))) { op = optab_for_tree_code (code, TREE_TYPE (type), optab_scalar); - if (optab_handler (op, TYPE_MODE (TREE_TYPE (type))) != CODE_FOR_nothing) + if (op >= FIRST_NORM_OPTAB && op <= LAST_NORM_OPTAB + && optab_handler (op, TYPE_MODE (TREE_TYPE (type))) != CODE_FOR_nothing) { tree slhs = make_ssa_name (TREE_TYPE (srhs1)); gimple *repl = gimple_build_assign (slhs, code, srhs1, srhs2);