public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/101641] Bogus redundant store removal
Date: Tue, 27 Jul 2021 12:08:13 +0000	[thread overview]
Message-ID: <bug-101641-4-MZ82A3WpN0@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-101641-4@http.gcc.gnu.org/bugzilla/>

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-07-27
             Status|UNCONFIRMED                 |ASSIGNED
           Keywords|                            |wrong-code

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
We're already going great lengths trying to preserve stores that change the
dynamic type in a way relevant for downstream users (which we actually do not
see).  In particular we've settled to

          alias_set_type set = ao_ref_alias_set (&lhs_ref);
          alias_set_type base_set = ao_ref_base_alias_set (&lhs_ref);
          if ((vnresult->set != set
               && ! alias_set_subset_of (set, vnresult->set))
              || (vnresult->base_set != base_set
                  && ! alias_set_subset_of (base_set, vnresult->base_set)))
            resultsame = false;

but this case is so degenerate that all the alias sets and base alias sets
of both pu->y (vnresult) and pu->x (lhs_ref) are 2 since we use the alias
set of the union type for all accesses that have the union in their path.

The only remaining chance we have here is to look at the actual types
and reject punning attempts.  We are really missing a way to preserve
the TBAA effect of a store but not the store itself.

  reply	other threads:[~2021-07-27 12:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-27 12:03 [Bug tree-optimization/101641] New: " rguenth at gcc dot gnu.org
2021-07-27 12:08 ` rguenth at gcc dot gnu.org [this message]
2021-07-29  8:09 ` [Bug tree-optimization/101641] " rguenth at gcc dot gnu.org
2021-07-29  8:55 ` rguenth at gcc dot gnu.org
2021-07-29  9:07 ` rguenth at gcc dot gnu.org
2021-07-29 18:04 ` muecker at gwdg dot de
2021-09-10  8:05 ` rguenth at gcc dot gnu.org
2021-09-28 10:20 ` rguenth 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-101641-4-MZ82A3WpN0@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).