public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r14-1496] analyzer: regions in different memory spaces can't alias
Date: Fri,  2 Jun 2023 13:29:12 +0000 (GMT)	[thread overview]
Message-ID: <20230602132912.87E133858D32@sourceware.org> (raw)

https://gcc.gnu.org/g:b8a916726e7f4b8871ac9dd75b66d26d1adf4798

commit r14-1496-gb8a916726e7f4b8871ac9dd75b66d26d1adf4798
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Fri Jun 2 09:28:30 2023 -0400

    analyzer: regions in different memory spaces can't alias
    
    gcc/analyzer/ChangeLog:
            * store.cc (store::eval_alias_1): Regions in different memory
            spaces can't alias.
    
    Signed-off-by: David Malcolm <dmalcolm@redhat.com>

Diff:
---
 gcc/analyzer/store.cc | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/gcc/analyzer/store.cc b/gcc/analyzer/store.cc
index e8c927b9fe9..4d1de825e79 100644
--- a/gcc/analyzer/store.cc
+++ b/gcc/analyzer/store.cc
@@ -2710,6 +2710,18 @@ tristate
 store::eval_alias_1 (const region *base_reg_a,
 		     const region *base_reg_b) const
 {
+  /* If they're in different memory spaces, they can't alias.  */
+  {
+    enum memory_space memspace_a = base_reg_a->get_memory_space ();
+    if (memspace_a != MEMSPACE_UNKNOWN)
+      {
+	enum memory_space memspace_b = base_reg_b->get_memory_space ();
+	if (memspace_b != MEMSPACE_UNKNOWN
+	    && memspace_a != memspace_b)
+	  return tristate::TS_FALSE;
+      }
+  }
+
   if (const symbolic_region *sym_reg_a
       = base_reg_a->dyn_cast_symbolic_region ())
     {

                 reply	other threads:[~2023-06-02 13:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20230602132912.87E133858D32@sourceware.org \
    --to=dmalcolm@gcc.gnu.org \
    --cc=gcc-cvs@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).