From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 126127 invoked by alias); 23 Feb 2017 08:57:29 -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 126117 invoked by uid 89); 23 Feb 2017 08:57:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=H*MI:sk:CAFiYyc, H*i:sk:cce14bb, HX-Received:Thu, H*f:sk:cce14bb X-HELO: mail-oi0-f52.google.com Received: from mail-oi0-f52.google.com (HELO mail-oi0-f52.google.com) (209.85.218.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 23 Feb 2017 08:57:27 +0000 Received: by mail-oi0-f52.google.com with SMTP id 2so14422059oif.0 for ; Thu, 23 Feb 2017 00:57:27 -0800 (PST) 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=iBQsTlCraDmRzpYmTbRsuXR59PkmBEw+1I6BlzyIkgs=; b=Dw+pgWZNWyOTr+yhOnbotzZIzxovarfceDR7B8HEs+Zkw5ztmGAL0iJJRn9vl5Tzfe dpZDMrg53Z0qzUjwXfraYwEgiLMdEF0SCbAkiKYjbVpIhGFuvfLuDlY3gYcN8ZYo1z6S MzcGh6nPaanFG0ZTC2NYtP2AHmgdF5N2rWXeML9mkrnu7JnlWXCdFPvxAXJRa3RMaj+m FIa7iF9XjBkNf2B8KnBCcwkDGXehCaHgNU6OnG61KphZvR2v+VcJ1ROYEDAeNcEkVJw1 LFNztzpywQQ5LoZEH2La2H3f2W5XLhCt7EfyQVgLirFrkfxgKD1BmUS/43D/Ra4YpMyF HYqw== X-Gm-Message-State: AMke39n0vfZQgzSM4FnsA/vMMlKpUJvb2XQXY/UxQ2rVSYFhg1YAnKobHvraoACFV2dW9uPABeAJ3yLBSWyOLQ== X-Received: by 10.202.76.146 with SMTP id z140mr19755482oia.68.1487840246394; Thu, 23 Feb 2017 00:57:26 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.40.120 with HTTP; Thu, 23 Feb 2017 00:57:26 -0800 (PST) In-Reply-To: References: <328a765e-5466-9740-d545-c1a620805ef9@redhat.com> From: Richard Biener Date: Thu, 23 Feb 2017 09:02:00 -0000 Message-ID: Subject: Re: fwprop fix for PR79405 To: Jeff Law Cc: Bernd Schmidt , GCC Patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2017-02/txt/msg01433.txt.bz2 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. Richard. > jeff >