From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2049) id 2E7B1385DC04; Thu, 5 May 2022 12:07:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2E7B1385DC04 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Matthew Malcomson To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/ARM/heads/morello)] analyzer: Fix type of ADDR_EXPR X-Act-Checkin: gcc X-Git-Author: Richard Sandiford X-Git-Refname: refs/vendors/ARM/heads/morello X-Git-Oldrev: 2d4829319d27485a96d9935446c47e91ee0fca40 X-Git-Newrev: ac5e91ff786f436c3648df7121c9d5ab29d58f7b Message-Id: <20220505120732.2E7B1385DC04@sourceware.org> Date: Thu, 5 May 2022 12:07:32 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2022 12:07:32 -0000 https://gcc.gnu.org/g:ac5e91ff786f436c3648df7121c9d5ab29d58f7b commit ac5e91ff786f436c3648df7121c9d5ab29d58f7b Author: Richard Sandiford Date: Mon Apr 11 18:45:53 2022 +0100 analyzer: Fix type of ADDR_EXPR The analyzer was creating an ADDR_EXPR with the type of the object whose address was being taken, rather than with the resulting pointer type. This patch cherry-picks a fix from David Malcolm in 467a48205279cab368dbeb02879bbbbe4b721516. Diff: --- gcc/analyzer/region-model.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/analyzer/region-model.cc b/gcc/analyzer/region-model.cc index 02bbfa54781..decd702dc4c 100644 --- a/gcc/analyzer/region-model.cc +++ b/gcc/analyzer/region-model.cc @@ -1881,7 +1881,7 @@ region_model::get_representative_path_var (const svalue *sval, const region *reg = ptr_sval->get_pointee (); if (path_var pv = get_representative_path_var (reg, visited)) return path_var (build1 (ADDR_EXPR, - TREE_TYPE (sval->get_type ()), + sval->get_type (), pv.m_tree), pv.m_stack_depth); }