* [pushed] analyzer: regions in different memory spaces can't alias
@ 2023-06-02 13:32 David Malcolm
0 siblings, 0 replies; only message in thread
From: David Malcolm @ 2023-06-02 13:32 UTC (permalink / raw)
To: gcc-patches; +Cc: David Malcolm
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
Pushed to trunk as r14-1496-gb8a916726e7f4b.
gcc/analyzer/ChangeLog:
* store.cc (store::eval_alias_1): Regions in different memory
spaces can't alias.
---
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 ())
{
--
2.26.3
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-06-02 13:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-02 13:32 [pushed] analyzer: regions in different memory spaces can't alias David Malcolm
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).