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: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH][PR tree-optimization/79578] Use operand_equal_p rather than pointer equality for base test
Date: Fri, 24 Feb 2017 10:05:00 -0000	[thread overview]
Message-ID: <CAFiYyc0W_cARyZVBpP1MuHRzvwdjkAmPcEBh38gVf+z1-mYaMQ@mail.gmail.com> (raw)
In-Reply-To: <069f125b-f064-97da-7bbf-219fc15d6ff4@redhat.com>

On Thu, Feb 23, 2017 at 10:06 PM, Jeff Law <law@redhat.com> wrote:
> On 02/23/2017 02:02 AM, Richard Biener wrote:
>
>>> diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c
>>> index 84c0b11..a82e164 100644
>>> --- a/gcc/tree-ssa-dse.c
>>> +++ b/gcc/tree-ssa-dse.c
>>> @@ -176,7 +176,7 @@ clear_bytes_written_by (sbitmap live_bytes, gimple
>>> *stmt, ao_ref *ref)
>>>    /* Verify we have the same base memory address, the write
>>>       has a known size and overlaps with REF.  */
>>>    if (valid_ao_ref_for_dse (&write)
>>> -      && write.base == ref->base
>>> +      && operand_equal_p (write.base, ref->base, 0)
>>
>>
>> As you've identified size and offset match you are really interested
>> in comparing the base addresses and thus should use OEP_ADDRESS_OF.
>
> I pondered that, but (perhaps incorrectly) thought that OEP_ADDRESS_OF was
> an optimization and that a more simple o_e_p with no flags was safer.
>
> I'm happy to change it, particularly if it's a correctness issue (in which
> case I think we've designed a horrible API for o_e_p, but such is life).  In
> fact, I've already bootstrapped and regression tested that change.

It's indeed an optimization to use OEP_ADDRESS_OF and 0 is more conservative.

Richard.

> jeff
>

      reply	other threads:[~2017-02-24 10:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-23  5:59 Jeff Law
2017-02-23  9:44 ` Richard Biener
2017-02-23 21:27   ` Jeff Law
2017-02-24 10:05     ` Richard Biener [this message]

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=CAFiYyc0W_cARyZVBpP1MuHRzvwdjkAmPcEBh38gVf+z1-mYaMQ@mail.gmail.com \
    --to=richard.guenther@gmail.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).