From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2140) id 4645A3857B8E; Fri, 23 Dec 2022 07:31:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4645A3857B8E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671780662; bh=9ulYdYuiJPSRNI2Si0LdA1nN8452kMTRNywLrLXWeDw=; h=From:To:Subject:Date:From; b=OEYog3TIDixJc+NrL14iAwu9Y55QXQz3R73fQwSpMA6F5InOcFVIq2uh9k/o2emdw 3pbQyTbgqJ0mI4StW2A8xdXYbqfP/MxhCufP0jErMuRNAock/NxWhNQRYiNjUpMsrF IYkGsB8YlbJF/XxQf/ZQ961ayeyJTBXQKglzhorQ= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Alexandre Oliva To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/aoliva/heads/testme)] hash table: insert before further lookups X-Act-Checkin: gcc X-Git-Author: Alexandre Oliva X-Git-Refname: refs/users/aoliva/heads/testme X-Git-Oldrev: c09625cbca67cab516571ebc45162fd0ec0f4c6f X-Git-Newrev: ace790a4e8118145be1f870299983715a092d6c1 Message-Id: <20221223073102.4645A3857B8E@sourceware.org> Date: Fri, 23 Dec 2022 07:31:02 +0000 (GMT) List-Id: https://gcc.gnu.org/g:ace790a4e8118145be1f870299983715a092d6c1 commit ace790a4e8118145be1f870299983715a092d6c1 Author: Alexandre Oliva Date: Thu Dec 22 21:28:47 2022 -0300 hash table: insert before further lookups Diff: --- gcc/tree-ssa-scopedtables.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gcc/tree-ssa-scopedtables.cc b/gcc/tree-ssa-scopedtables.cc index 6d203ef89ec..3e6e129e7d5 100644 --- a/gcc/tree-ssa-scopedtables.cc +++ b/gcc/tree-ssa-scopedtables.cc @@ -259,11 +259,6 @@ avail_exprs_stack::lookup_avail_expr (gimple *stmt, bool insert, bool tbaa_p, } else if (*slot == NULL) { - /* If we did not find the expression in the hash table, we may still - be able to produce a result for some expressions. */ - tree retval = avail_exprs_stack::simplify_binary_operation (stmt, - element); - /* We have, in effect, allocated *SLOT for ELEMENT at this point. We must initialize *SLOT to a real entry, even if we found a way to prove ELEMENT was a constant after not finding ELEMENT @@ -277,6 +272,11 @@ avail_exprs_stack::lookup_avail_expr (gimple *stmt, bool insert, bool tbaa_p, class expr_hash_elt *element2 = new expr_hash_elt (element); *slot = element2; + /* If we did not find the expression in the hash table, we may still + be able to produce a result for some expressions. */ + tree retval = avail_exprs_stack::simplify_binary_operation (stmt, + element); + record_expr (element2, NULL, '2'); return retval; }