From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 129790 invoked by alias); 7 Dec 2018 15:26:51 -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 129777 invoked by uid 89); 7 Dec 2018 15:26:50 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,KAM_NUMSUBJECT,SPF_HELO_PASS autolearn=no version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 07 Dec 2018 15:26:49 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F272D308ED62; Fri, 7 Dec 2018 15:26:47 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-17.rdu2.redhat.com [10.10.112.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id E9F8379D7D; Fri, 7 Dec 2018 15:26:46 +0000 (UTC) Subject: Re: [PATCH] Fix PR63184 To: Richard Biener , gcc-patches@gcc.gnu.org References: From: Jeff Law Openpgp: preference=signencrypt Message-ID: <247d03c8-7e8a-9bb2-f233-924d84a33f85@redhat.com> Date: Fri, 07 Dec 2018 15:26:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg00468.txt.bz2 On 12/7/18 3:55 AM, Richard Biener wrote: > On Fri, 7 Dec 2018, Richard Biener wrote: > >> >> The following fixes PR63184 by using tree-affine to resolve pointer >> comparisons. Instead of trying to stick this into a match.pd pattern >> the following does this in the more constrained forwprop environment. >> >> I've only implemented the cases where the comparison resolves to a >> compile-time value, not the case where for example &a[i] < &a[j] >> could be simplified to i < j. I'm not sure I can trust the >> tree-affine machinery enough here to do that. >> >> Both testcases require some CSE to happen thus the first forwprop >> pass doesn't catch it. >> >> Bootstrap & regtest running on x86_64-unknown-linux-gnu. >> >> I'll collect some statistics from bootstrap. > > Somewhat depressing. There's a single instance in > libiberty/rust-demangle.c that gets resolved (a ordered compare). > This instance triggers 4 times during a c,c++ bootstrap compared > to 258098 affine expansion combinations tried. > > It doesn't trigger in tramp3d at all (just to try a C++ code base). > > I suspect the cases in PR63184 are arcane enough and usually we > have simpler addresses that are resolved with the existing > patterns. > > I'll attach the patch to the PR and leave it alone. Seems reasonable to me as well. It's originally your BZ and somewhere in it I think you indicated you didn't think it was terribly important. I'd suggest pushing it out to P4. But I know you don't like that, so I won't actually do it :-) Jeff