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 c++/111019] [12/13/14 Regression] Optimizer incorrectly assumes variable is not changed while change happens through another pointer
Date: Thu, 17 Aug 2023 12:53:26 +0000	[thread overview]
Message-ID: <bug-111019-4-C5f3kBPYte@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-111019-4@http.gcc.gnu.org/bugzilla/>

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu.org

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
And what in the end disambiguates this in LIM is aliasing_component_refs_p.
Note that LIM feeds it canonicalized __MEM <struct Target> ((struct Target
*)_26).D_43475.next, it instead uses MEM[(struct Base * *)_26 + 8B].

I think it goes wrong because LIM canonicalizes _26->...next which is a
ref at offset 8 to MEM[_26 + 8] _at offset 8_, the base is actually
recorded as MEM[_26] but get_ref_base_and_extent wouldn't get 8 out of
MEM[_26 + 8] and aliasing_matching_component_refs_p re-does that to adjust
the offset which in the end leads to some inconsistency.

What LIM tries to do is find a canonical representation for the ref which
is MEM[_26 + 8B], it also tries to preserve the base which is MEM[_26],
but that's somewhat in conflict here.  It works for LIMs purposes but as
can be seen it doesn't work here.

The bad thing is that there isn't a consistent representation for this,
but also aliasing_matching_component_refs_p relying on this is bad?

  parent reply	other threads:[~2023-08-17 12:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-14 22:00 [Bug c++/111019] New: " boskidialer at gmail dot com
2023-08-15  8:55 ` [Bug c++/111019] [12/13/14 Regression] " rguenth at gcc dot gnu.org
2023-08-15 12:59 ` ppalka at gcc dot gnu.org
2023-08-15 13:39 ` rguenther at suse dot de
2023-08-15 16:15 ` boskidialer at gmail dot com
2023-08-17  6:49 ` rguenth at gcc dot gnu.org
2023-08-17 12:08 ` rguenth at gcc dot gnu.org
2023-08-17 12:53 ` rguenth at gcc dot gnu.org [this message]
2023-08-17 13:00 ` rguenth at gcc dot gnu.org
2023-08-17 13:24 ` rguenth at gcc dot gnu.org
2023-08-18 13:05 ` cvs-commit at gcc dot gnu.org
2023-08-18 13:11 ` [Bug c++/111019] [12/13 " rguenth at gcc dot gnu.org
2023-08-21 11:27 ` boskidialer at gmail dot com
2023-08-24 10:56 ` cvs-commit at gcc dot gnu.org
2023-11-27 11:35 ` [Bug tree-optimization/111019] [12 " cvs-commit at gcc dot gnu.org
2023-11-27 11:37 ` 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-111019-4-C5f3kBPYte@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).