public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Jeff Law <law@redhat.com>
Cc: Bernd Schmidt <bschmidt@redhat.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: fwprop fix for PR79405
Date: Thu, 23 Feb 2017 09:02:00 -0000	[thread overview]
Message-ID: <CAFiYyc19LUxOmN3KWYwJV5jwG5AF2BU7yp-wvK3=0dQ_J7b9qA@mail.gmail.com> (raw)
In-Reply-To: <cce14bb3-d166-3490-c13c-9b7753ed0ec6@redhat.com>

On Wed, Feb 22, 2017 at 6:19 PM, Jeff Law <law@redhat.com> 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
>

  reply	other threads:[~2017-02-23  8:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-16 19:44 Bernd Schmidt
2017-02-17  9:11 ` Richard Biener
2017-02-17  9:21   ` Richard Biener
2017-02-20 14:02     ` Bernd Schmidt
2017-02-20 17:15       ` Richard Biener
2017-02-22 17:54 ` Jeff Law
2017-02-23  9:02   ` Richard Biener [this message]
2017-02-23 22:21     ` Jeff Law
2017-02-24 10:08       ` Richard Biener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFiYyc19LUxOmN3KWYwJV5jwG5AF2BU7yp-wvK3=0dQ_J7b9qA@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=bschmidt@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).