From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 120357 invoked by alias); 28 Apr 2017 12:25:57 -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 120245 invoked by uid 89); 28 Apr 2017 12:25:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy= X-HELO: mail-io0-f182.google.com Received: from mail-io0-f182.google.com (HELO mail-io0-f182.google.com) (209.85.223.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 28 Apr 2017 12:25:55 +0000 Received: by mail-io0-f182.google.com with SMTP id p80so61366650iop.3 for ; Fri, 28 Apr 2017 05:25:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=S862ay1KAq1MjG/EZ4PRE4DzgKzDzbdSTftQ1/+fo5c=; b=XcE9GxElZmVnB8teLsyGVnzQt3Nvsc7xNj9Kfs4+IInmo4oVHQkbqPkV4SrVTETyFT r6l8jfVXQ8oGCf6pf5WjcJI+cnn8vcw95wWrRJbB15RUl2x/Yqm9+CIFGXYxEKKevdbz NK6HYk2O7s/MwmwxX86Z+aJGl6NlKXrhht0lfksksjdRAcehtRSX5FVS6wFmFEOtb12j 0clGP0EyGSRv7Pi4kroLPFTHFgvnfAXXgXHmCO5N1LMawfWP5DdGmfxdPFAdsfS+J7yC JGaB8v8YzLJoPouIt2luh0cHbDHYUlbd28TxsP40Owf7X3THFjEwD25YIOSRSxDYMMHo 3SGw== X-Gm-Message-State: AN3rC/6G8+5c34mkEEjOm7cxlYLCxOM9nEKz6MADQNqdrkmHTlqCHexi aGZwSur6Kcb6QQpsGNo3vgxX6zKWuQ== X-Received: by 10.157.33.98 with SMTP id l31mr4673103otd.245.1493382356077; Fri, 28 Apr 2017 05:25:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.51.83 with HTTP; Fri, 28 Apr 2017 05:25:55 -0700 (PDT) In-Reply-To: References: From: Richard Biener Date: Fri, 28 Apr 2017 12:50:00 -0000 Message-ID: Subject: Re: Drop Z from X + Z < Y + Z To: Marc Glisse Cc: GCC Patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2017-04/txt/msg01484.txt.bz2 On Fri, Apr 28, 2017 at 1:35 PM, Marc Glisse wrote: > Hello, > > surprisingly, this did not cause any Wstrict-overflow failure. Some of it > sounds more like reassoc's job, but it is convenient to handle simple cases > in match.pd. I think we could wait until there are reports of regressions > related to register pressure before adding single_use tests. > > For a std::vector v, we now simplify v.size()==v.capacity() to a > single comparison (long)finish==(long)end_storage (I guess I could still try > to drop the casts to consider it really done). Handling > v.size() choice to use unsigned types. I may still be able to remove the divisions, > I'll see if I can sprinkle some 'convert' in recent transformations. > > Bootstrap+regtest on powerpc64le-unknown-linux-gnu. +(for cmp (eq ne minus) Fat fingered 'minus' (in all places) or did you want to get fancy? (the transforms look valid even for cmp == minus) Maybe adjust comments to reflect this. There are a few related cases in fold-const.c, namely X +- Y CMP X -> Y CMP 0, some of them also handling POINTER_PLUS_EXPR. So I wonder if you can handle pointer_plus like plus and maybe move those fold-const.c patterns. Can be done as followup of course. Ok with minus removed or comments adjusted. Thanks, Richard. > 2017-04-28 Marc Glisse > > gcc/ > * match.pd (X+Z CMP Y+Z, X-Z CMP Y-Z, Z-X CMP Z-Y): New > transformations. > > gcc/testsuite/ > * gcc.dg/tree-ssa/cmpexactdiv-2.c: Update for X-Z CMP Y-Z. > > -- > Marc Glisse