From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2140) id 91B533857BB3; Fri, 23 Dec 2022 05:26:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 91B533857BB3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671773217; bh=tyY8pTUQxODktk6gnOWSsMr5nD4v94RxVEknvj7+fn4=; h=From:To:Subject:Date:From; b=yDnVkLX+b5SndDMfwAqQ+cNyxISASw3MWBtlNdxF/ewKb51JKTwjqD6U0Jav18dIb Z2ZVO/DjZ7Gqry04xykJAYZs0rSX/Bt8MHq4Nk3g+eweotuNyB+jitAhTfH2LNVjkt 3kampCn5/BOfYgO+EUjV4zgDXuuDwQdmH4BFs0yI= 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: 34dc1fc7981c62fb55f5e9844308194925c09b61 X-Git-Newrev: 08df3b23b8f36e2388ae648dde07b4b17a69fa9a Message-Id: <20221223052657.91B533857BB3@sourceware.org> Date: Fri, 23 Dec 2022 05:26:57 +0000 (GMT) List-Id: https://gcc.gnu.org/g:08df3b23b8f36e2388ae648dde07b4b17a69fa9a commit 08df3b23b8f36e2388ae648dde07b4b17a69fa9a 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; }