From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16685 invoked by alias); 23 Feb 2017 22:17:26 -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 16649 invoked by uid 89); 23 Feb 2017 22:17: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,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=H*MI:sk:CAFiYyc, H*i:sk:CAFiYyc, H*f:sk:cce14bb, H*f:sk:0dQ_J7b 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; Thu, 23 Feb 2017 22:17:24 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5054BC00B903; Thu, 23 Feb 2017 22:17:24 +0000 (UTC) Received: from localhost.localdomain (ovpn-124-0.rdu2.redhat.com [10.10.124.0] (may be forged)) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1NMHMxs031694; Thu, 23 Feb 2017 17:17:23 -0500 Subject: Re: fwprop fix for PR79405 To: Richard Biener References: <328a765e-5466-9740-d545-c1a620805ef9@redhat.com> Cc: Bernd Schmidt , GCC Patches From: Jeff Law Message-ID: <2ce95995-20d2-c24f-f7bd-ececceaf9f09@redhat.com> Date: Thu, 23 Feb 2017 22:21:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-02/txt/msg01476.txt.bz2 On 02/23/2017 01:57 AM, Richard Biener wrote: > On Wed, Feb 22, 2017 at 6:19 PM, Jeff Law wrote: >> On 02/16/2017 12:41 PM, Bernd Schmidt wrote: >>> >>> We have two registers being assigned to each other: >>> >>> (set (reg 213) (reg 209)) >>> (set (reg 209) (reg 213)) >>> >>> These being the only definitions, we are happy to forward propagate reg >>> 209 for reg 213 into a third insn, making a new use for reg 209. We are >>> then happy to forward propagate reg 213 for it in the same insn... >>> ending up in an infinite loop. >>> >>> I don't really see an elegant way to prevent this, so the following just >>> tries to detect the situation (and more general ones) by brute force. >>> Bootstrapped and tested on x86_64-linux, verified that the test passes >>> with a ppc cross, ok? >>> >>> >>> Bernd >>> >>> >>> 79405.diff >>> >>> >>> PR rtl-optimization/79405 >>> * fwprop.c (forward_propagate_into): Detect potentially cyclic >>> replacements and bail out for them. >>> >>> PR rtl-optimization/79405 >>> * gcc.dg/torture/pr79405.c: New test. >> >> OK. > > Err - this looks quite costly done for each fwprop. And placing it before > less costly bailouts even... > > See my discussion with Bernd anyway. I read your last message as being OK with Bernd's approach? Did I mis-understand? jeff