From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2209) id 87E133858D32; Fri, 2 Jun 2023 13:29:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 87E133858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685712552; bh=rSZcUejY7A79papVChTPz0I2jPspcIw5rnQE/aNNtXM=; h=From:To:Subject:Date:From; b=cOuHpBGPUbzwFYnxdVzVJ7oFvFf2cj3ef6TjUMufmqLxwYCK7sc+1B0JBiDwIWMgY 9y2M+3/OEPskoubbSHlov3mKjkLVbK4aBkaiP1UuctEu8ITff7BEABJaXNnOZHy5uq z0b6qY5r10hRSVBs30wV3Gna5w9LbOaF0FE/1Dmk= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: David Malcolm To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-1496] analyzer: regions in different memory spaces can't alias X-Act-Checkin: gcc X-Git-Author: David Malcolm X-Git-Refname: refs/heads/master X-Git-Oldrev: 23f352972faabe94606687558a66135f9a9e17fb X-Git-Newrev: b8a916726e7f4b8871ac9dd75b66d26d1adf4798 Message-Id: <20230602132912.87E133858D32@sourceware.org> Date: Fri, 2 Jun 2023 13:29:12 +0000 (GMT) List-Id: https://gcc.gnu.org/g:b8a916726e7f4b8871ac9dd75b66d26d1adf4798 commit r14-1496-gb8a916726e7f4b8871ac9dd75b66d26d1adf4798 Author: David Malcolm 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 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 ()) {