public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Marc Glisse <marc.glisse@inria.fr>
To: Richard Biener <richard.guenther@gmail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: DSE calls to builtins (memset, etc)
Date: Wed, 20 Aug 2014 14:18:00 -0000	[thread overview]
Message-ID: <alpine.DEB.2.11.1408201553100.1778@laptop-mg.saclay.inria.fr> (raw)
In-Reply-To: <CAFiYyc3ygEDYjkKkCozuNjAUo3dJ1cDJfHXEW=W6bzP4SAkbDg@mail.gmail.com>

On Wed, 20 Aug 2014, Richard Biener wrote:

>>>> -      if (stmt != use_stmt
>>>> -         && ref_maybe_used_by_stmt_p (use_stmt, gimple_assign_lhs
>>>> (stmt)))
>>>> -       return;
>>>> -
>>>
>>>
>>> I don't see how you can remove this code?
>>
>>
>> dse_possible_dead_store_p already tests ref_maybe_used_by_stmt_p and
>> thus cannot return true with such a use_stmt, as far as I can see. As I
>> said, bootstrap+testsuite with an assert instead of 'return' didn't turn
>> up anything. I could keep it as a gcc_checking_assert (with a slight
>> update to the comment) if you like. Or did I miss a path in
>> dse_possible_dead_store_p?
>
> Yes, the one that early returns from the operand_equal_p check.
>
> You might want to do some svn blaming to see what testcases
> were added with the above code (and the code surrounding it).
>
> I'm not sure either... so if it passes bootstrap & regtest it must be
> dead code... (well...)

The early return operand_equal_p has use_stmt == stmt, so it doesn't even 
reach the call to ref_maybe_used_by_stmt_p I am removing.

svn blame leads me to r132899 (gcc.c-torture/execute/pr35472.c)
and before that to r131101 (gcc.c-torture/execute/20071219-1.c)

Both testcases are still in the testsuite and passed. The rest of the code 
has changed quite a bit since then, it isn't that surprising if some test 
becomes redundant. But if it makes you nervous, we could keep it as a 
checking_assert, the cost should be negligible...

-- 
Marc Glisse

  reply	other threads:[~2014-08-20 14:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-16 21:22 Marc Glisse
2014-08-19 13:29 ` Richard Biener
2014-08-19 14:16   ` Marc Glisse
2014-08-20  7:14     ` Marc Glisse
2014-08-20 13:53       ` Richard Biener
2014-08-20 14:31         ` Marc Glisse
2014-08-20 14:35           ` Marc Glisse
2014-08-20 14:37           ` Richard Biener
2014-08-20 13:51     ` Richard Biener
2014-08-20 14:18       ` Marc Glisse [this message]
2014-08-20 14:28         ` Richard Biener
2014-08-20 15:05           ` Marc Glisse
2014-08-21  8:23             ` 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=alpine.DEB.2.11.1408201553100.1778@laptop-mg.saclay.inria.fr \
    --to=marc.glisse@inria.fr \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.guenther@gmail.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).