From patchwork Fri Jun 10 02:19:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kugan Vivekanandarajah X-Patchwork-Id: 69739 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp71749qgf; Thu, 9 Jun 2016 19:20:07 -0700 (PDT) X-Received: by 10.66.148.74 with SMTP id tq10mr15994502pab.21.1465525207676; Thu, 09 Jun 2016 19:20:07 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id xm3si8951959pac.158.2016.06.09.19.20.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jun 2016 19:20:07 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-429495-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-429495-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-429495-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=qtP45Cl9k3vogdFjXo2wSgl4qU4ASH86tXToETyWHdML2ecAbL V3GR38U6aqkQ7YEAKllEDjyAvRTcD0S4grdOsMvFSexU1Vg5xZLzC09DxnlYMaFy kLDlFFq1ZfnD6gLNZ6aFcO/6Yoi4Ftc5wMACQVPHHTsaCzuwwHnqAbuIg= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=qAtkbmrAb7RLiBqXPteEkCcGrac=; b=TzbuLzy5JO+MsPWH0lFb 9euulD+aVsuCbJG56xviysGTlvGTNmUh1VnbafztDz18VkOPnTqzcZcSGgvWo1mV +sCAa+PSjVLTYmYi+2v9olWbXsEhiatJpbhxuMR75hov6jTsC+eLGvJJsXGzLgc0 RQzxSB/p1Y/qciiXf6GtGXA= Received: (qmail 103874 invoked by alias); 10 Jun 2016 02:19:55 -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 103857 invoked by uid 89); 10 Jun 2016 02:19:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=2016-06-10, MULT_EXPR, mult_expr, 20160610 X-HELO: mail-pa0-f50.google.com Received: from mail-pa0-f50.google.com (HELO mail-pa0-f50.google.com) (209.85.220.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 10 Jun 2016 02:19:40 +0000 Received: by mail-pa0-f50.google.com with SMTP id ec8so18773102pac.0 for ; Thu, 09 Jun 2016 19:19:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version; bh=yURPaOEZl923b64UIO5+41QPW78k1YLirMofBAFa71s=; b=QPjAcbIDMzGSu148ut/mKno6fqBnaNHV6xCcMH+Wigxncva7ea6oJUgm1vwalk06s9 v149TDQvSgf0Uu1ZdNk1cW7ur1enmYvGJtvRzL8+dZ7bMSvdX73HPzWrz//mJMn5yB7G sXQt7+0gt5GhF5Sbcn8IBc/euL7GZPuxQKAn3+gPO3qCQfINq/Dw+V8B2+4Jl3ewtUER 6ZAMzu+OFzlEXt52uQxIoLYBa1FKYSqRwwY1XggFFmGueAc54i3VWPnYPAwEMV4lWEk/ bpME282at7iLw2kBddzioRvD/ffuFVMIKvK+c8oPgYVRe9dWHkkzUqKyLCDcz7mudNGg 4iCA== X-Gm-Message-State: ALyK8tI+XGWN2K7gWe/yCbai8jX/gixOuM8Jv2ovqEPe77JRhbFgYLTYFNPzuxG6cvbQ5awL X-Received: by 10.66.139.133 with SMTP id qy5mr15884510pab.4.1465525178305; Thu, 09 Jun 2016 19:19:38 -0700 (PDT) Received: from [10.1.1.13] (58-6-183-210.dyn.iinet.net.au. [58.6.183.210]) by smtp.gmail.com with ESMTPSA id 17sm12962120pfj.96.2016.06.09.19.19.36 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 09 Jun 2016 19:19:37 -0700 (PDT) To: "gcc-patches@gcc.gnu.org" , Richard Biener From: kugan Subject: [PR71478] Fix ICE in tree-ssa-reassoc.c Message-ID: <575A23AD.3040204@linaro.org> Date: Fri, 10 Jun 2016 12:19:25 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 X-IsSubscribed: yes Hi, In PR71478, for vector negation of ssa produced by call stmt, we add vector (-1) and ssa to the ops list. However, in the place where we remove the (-1) from ops list, we failed to do this for vector integer. As a result, rewrite_expr_tree wrongly assumes that it is working with gimple_assign. Attached patch fixes the place where we remove the vector (-1). Regression tested on x86-64-linux-gnu with no new regressions. Regression testing on aarc64-linux-gnu is ongoing. Is this OK for trunk? Thanks, Kugan gcc/testsuite/ChangeLog: 2016-06-10 Kugan Vivekanandarajah * gcc.dg/pr71478.c: New test. gcc/ChangeLog: 2016-06-10 Kugan Vivekanandarajah * tree-ssa-reassoc.c (reassociate_bb): Remove (-1) from ops list for vector integer type. diff --git a/gcc/testsuite/gcc.dg/pr71478.c b/gcc/testsuite/gcc.dg/pr71478.c index e69de29..7b9cce6 100644 --- a/gcc/testsuite/gcc.dg/pr71478.c +++ b/gcc/testsuite/gcc.dg/pr71478.c @@ -0,0 +1,21 @@ +/* PR target/71478 */ +/* { dg-require-effective-target vect_int } */ +/* { dg-do compile } */ +/* { dg-options "-O3" } */ + +typedef unsigned int __attribute__ ((vector_size (8))) uv2si; +typedef int __attribute__ ((vector_size (8))) v2si; + +uv2si bar (v2si); + +uv2si +foo (void) +{ + v2si x = (v2si) (0x00007fff80008000UL); + v2si y = (v2si) (0x8f997fff00000000UL); + uv2si z = x >= y; + uv2si k = bar (x); + uv2si j = k * __builtin_shuffle (z, z, (uv2si) {1, 3}); + return k * j; +} + diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c index 36b34d3..e32d503 100644 --- a/gcc/tree-ssa-reassoc.c +++ b/gcc/tree-ssa-reassoc.c @@ -5303,8 +5303,7 @@ reassociate_bb (basic_block bb) && rhs_code == MULT_EXPR) { last = ops.last (); - if (((TREE_CODE (last->op) == INTEGER_CST - && integer_minus_onep (last->op)) + if ((integer_minus_onep (last->op) || real_minus_onep (last->op)) && !HONOR_SNANS (TREE_TYPE (lhs)) && (!HONOR_SIGNED_ZEROS (TREE_TYPE (lhs))