public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hubicka at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug testsuite/103282] New test case gcc.dg/tree-ssa/modref-dse-5.c in r12-5292 fails
Date: Mon, 22 Nov 2021 10:55:55 +0000	[thread overview]
Message-ID: <bug-103282-4-S30eHy4qqt@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103282-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103282

--- Comment #9 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
So the problem is that dse is giving up on determining if partial stores was
killed.  This is completely unnecesary: one can kill partial store by a full
store.

diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c
index 9531d892f76..c07782d680b 100644
--- a/gcc/tree-ssa-dse.c
+++ b/gcc/tree-ssa-dse.c
@@ -197,11 +197,11 @@ normalize_ref (ao_ref *copy, ao_ref *ref)
     }

   poly_int64 diff = copy->offset - ref->offset;
-  if (maybe_le (ref->size, diff))
+  if (maybe_le (ref->max_size, diff))
     return false;

   /* If COPY extends beyond REF, chop off its size appropriately.  */
-  poly_int64 limit = ref->size - diff;
+  poly_int64 limit = ref->max_size - diff;
   if (!ordered_p (limit, copy->size))
     return false;

@@ -266,8 +266,12 @@ static bool
 setup_live_bytes_from_ref (ao_ref *ref, sbitmap live_bytes)
 {
   HOST_WIDE_INT const_size;
-  if (valid_ao_ref_for_dse (ref)
-      && ref->size.is_constant (&const_size)
+  if (ao_ref_base (ref)
+      && known_size_p (ref->max_size)
+      && known_ge (ref->offset, 0)
+      && multiple_p (ref->offset, BITS_PER_UNIT)
+      && multiple_p (ref->max_size, BITS_PER_UNIT)
+      && ref->max_size.is_constant (&const_size)
       && (const_size / BITS_PER_UNIT
          <= param_dse_max_object_size))
     {

  parent reply	other threads:[~2021-11-22 10:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-16 18:32 [Bug testsuite/103282] New: " seurer at gcc dot gnu.org
2021-11-16 19:25 ` [Bug testsuite/103282] " hjl.tools at gmail dot com
2021-11-16 22:03 ` hubicka at gcc dot gnu.org
2021-11-18 19:24 ` seurer at gcc dot gnu.org
2021-11-19  6:54 ` pinskia at gcc dot gnu.org
2021-11-19  6:57 ` pinskia at gcc dot gnu.org
2021-11-19 11:41 ` hubicka at gcc dot gnu.org
2021-11-19 16:13 ` seurer at gcc dot gnu.org
2021-11-22  9:38 ` hubicka at gcc dot gnu.org
2021-11-22 10:55 ` hubicka at gcc dot gnu.org [this message]
2021-11-23 10:00 ` hubicka at gcc dot gnu.org
2021-11-26  0:41 ` hubicka at gcc dot gnu.org

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=bug-103282-4-S30eHy4qqt@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).