public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/92294] alias attribute generates incorrect code
Date: Tue, 19 Jan 2021 17:51:17 +0000	[thread overview]
Message-ID: <bug-92294-4-rYR7MhxJmx@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-92294-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Sandiford <rsandifo@gcc.gnu.org>:

https://gcc.gnu.org/g:6a2a38620cf178b53b217051f32d1d7bbba86fc9

commit r11-6796-g6a2a38620cf178b53b217051f32d1d7bbba86fc9
Author: Richard Sandiford <richard.sandiford@arm.com>
Date:   Tue Jan 19 17:50:53 2021 +0000

    alias: Fix offset checks involving section anchors [PR92294]

    memrefs_conflict_p assumes that:

      [XB + XO, XB + XO + XS)

    does not alias

      [YB + YO, YB + YO + YS)

    whenever:

      [XO, XO + XS)

    does not intersect

      [YO, YO + YS)

    In other words, the accesses can alias only if XB == YB at runtime.

    However, this doesn't cope correctly with section anchors.
    For example, if XB is an anchor symbol and YB is at offset
    XO from the anchor, then:

      [XB + XO, XB + XO + XS)

    overlaps

      [YB, YB + YS)

    whatever the value of XO is.  In other words, when doing the
    alias check for two symbols whose local definitions are in
    the same block, we should apply the known difference between
    their block offsets to the intersection test above.

    gcc/
            PR rtl-optimization/92294
            * alias.c (compare_base_symbol_refs): Take an extra parameter
            and add the distance between two symbols to it.  Enshrine in
            comments that -1 means "either 0 or 1, but we can't tell
            which at compile time".
            (memrefs_conflict_p): Update call accordingly.
            (rtx_equal_for_memref_p): Likewise.  Take the distance between
symbols
            into account.

  parent reply	other threads:[~2021-01-19 17:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-92294-4@http.gcc.gnu.org/bugzilla/>
2020-05-07 11:56 ` jakub at gcc dot gnu.org
2020-07-23  6:51 ` rguenth at gcc dot gnu.org
2020-11-13  9:30 ` mhillen at linux dot ibm.com
2020-11-19 11:03 ` mhillen at linux dot ibm.com
2020-11-19 13:02 ` mhillen at linux dot ibm.com
2020-11-23 20:49 ` rsandifo at gcc dot gnu.org
2021-01-19 17:51 ` cvs-commit at gcc dot gnu.org [this message]
2021-01-19 17:53 ` rsandifo at gcc dot gnu.org
2022-02-11  9:13 ` pinskia 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-92294-4-rYR7MhxJmx@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).