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: 633482 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 3rQm906Vgnz9sBf for ; Fri, 10 Jun 2016 12:20:03 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=W+viFWw7; 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:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=g4Up+T1zsLEb7C3SEyTTsE354daQLBo1vdHxKxk0KDt1WxGDgB znl9A0zLKm/pcLd7dwYW0zZ0nmP3co4wZLzFkuOhSS9l0jZXpXcR3QhPLVzzPew8 U4OLqWDoCS0/DefOhs3I03V015s75vO6kf+7Sz7xlMuqJQNptaUzp/OpA= 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=W+viFWw7RJPbptI3Lrdd IAUDDFzIjfIrOnsEUo+Btr3Ay0mZKdniP6atGBmBj5LFFzlpfXg5aiVHgKeDpAV0 mvPQniIiJbMM5K2vP/Peg5cdSuGjP/gUxBlM0U/xyERSPuRM9ZLlC+l9/RK7PaSN WWQtDgSXagUXw22bSyTTx0w= 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))