From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 50529 invoked by alias); 23 Nov 2016 09:56:27 -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 50516 invoked by uid 89); 23 Nov 2016 09:56:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=D*cavium.com, Hx-languages-length:1360, orders, late X-HELO: mail-wj0-f178.google.com Received: from mail-wj0-f178.google.com (HELO mail-wj0-f178.google.com) (209.85.210.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 23 Nov 2016 09:56:16 +0000 Received: by mail-wj0-f178.google.com with SMTP id v7so6188344wjy.2 for ; Wed, 23 Nov 2016 01:56:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=z3bLHtmynZteNIvVBnRUzs3pwI1fwVQsbyjyH1inBHg=; b=bKmkDg79+ubP1FwYbMIXdS2RvRlaRHR+wdyl1cyrEseGBuLq3wTk16mmP509t4Eaxf 2g+Z6FiEFe3KkErIGIbUxhcI2wiTfCrw9BkH2KKwZbLOMZHDkcvnXmY13zkpyHBcJ5Wl 64L7NDoE9AddZhg0NBUoWX8KgeBoxAAYl6rF/qHwYxoX55iDKRO9WhGsXXds3ZcZ22oN pgFI//FxpeszLJ9/dPIhJWrTxZE99Yop33Kiso2NTZD3kmvQXksIKZJgh2L12GYVWLJD F+GwB1kOYjioOR2FrKdhYjdw74EiCMCxgffIMQUr495yAw4TWZ5rpezWR5qx/+E0/txB 5Zpg== X-Gm-Message-State: AKaTC02ksVC1rS+aR0poJS04xExpFgLf4iJi/4Z2s5G0fA+Zm08OZnxI2iI1gh9QCTi2RYumEgOifc8sU5jepQ== X-Received: by 10.195.13.70 with SMTP id ew6mr2335355wjd.89.1479894974400; Wed, 23 Nov 2016 01:56:14 -0800 (PST) MIME-Version: 1.0 Received: by 10.28.73.215 with HTTP; Wed, 23 Nov 2016 01:56:13 -0800 (PST) In-Reply-To: References: <24a5ed27-a4da-043c-4e99-18db1f1dad7b@redhat.com> From: Richard Biener Date: Wed, 23 Nov 2016 09:56:00 -0000 Message-ID: Subject: Re: [PATCH] Fix PR31096 To: "Hurugalawadi, Naveen" Cc: Jeff Law , "marc.glisse@inria.fr" , "ramana.radhakrishnan@foss.arm.com" , "gcc-patches@gcc.gnu.org" Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2016-11/txt/msg02320.txt.bz2 On Fri, Nov 11, 2016 at 11:19 AM, Hurugalawadi, Naveen wrote: > Hi, > > Sorry for a very late reply as the mail was missed or overlooked. > >>> could now move the test tree_expr_nonzero_p next to >>> tree_expr_nonnegative_p (it is redundant for the last case). > > Done. > >>> Often just a comment can really help here. > > Comments updated as per the suggestion > >>> when C is zero and verify this transformation doesn't fire on that case. > > Updated test to check with zero. > >>> verifying that the operand orders change appropriately when dealing >>> with a negative constant. > > Done. > >>> verify nothing happens with floating point or vector types. > > Done. > > Please review the patch and let me know if any modifications are required. > Regression tested on X86 and AArch64. Ok with using wi::neg_p (@1, TYPE_SIGN (TREE_TYPE (@1))) instead of wi::lt_p. Thanks, Richard. > Thanks, > Naveen > > 2016-11-11 Naveen H.S > gcc > * fold-const.c (tree_expr_nonzero_p) : Make non-static. > * fold-const.h (tree_expr_nonzero_p) : Declare. > * match.pd (cmp (mult:c @0 @1) (mult:c @2 @1) : New Pattern. > * match.pd (cmp (mult:c @0 @1) (mult:c @2 @1) : New Pattern. > gcc/testsuite > * gcc.dg/pr31096.c: New testcase. > * gcc.dg/pr31096-1.c: New testcase.