From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2136) id 029F1385C413; Sun, 24 Jul 2022 15:04:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 029F1385C413 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Aldy Hernandez To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-1813] Allow registering same SSA name relations in oracle. X-Act-Checkin: gcc X-Git-Author: Aldy Hernandez X-Git-Refname: refs/heads/master X-Git-Oldrev: e850c98f1f06721126606ad3439d7cd9393c687c X-Git-Newrev: 4a36b4e1fe405fe347d57c39f8e23ac8a6c57263 Message-Id: <20220724150456.029F1385C413@sourceware.org> Date: Sun, 24 Jul 2022 15:04:55 +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: Sun, 24 Jul 2022 15:04:56 -0000 https://gcc.gnu.org/g:4a36b4e1fe405fe347d57c39f8e23ac8a6c57263 commit r13-1813-g4a36b4e1fe405fe347d57c39f8e23ac8a6c57263 Author: Aldy Hernandez Date: Wed Jul 20 20:36:54 2022 +0200 Allow registering same SSA name relations in oracle. Similarly to what we did for the relation oracle, but for the path oracle. This was found while working on frange, where we can test for x == x while checking for NANness. Tested on x86-64 Linux. gcc/ChangeLog: * value-relation.cc (value_relation::set_relation): Remove assert. (path_oracle::register_relation): Exit when trying to register same SSA name relations. Diff: --- gcc/value-relation.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gcc/value-relation.cc b/gcc/value-relation.cc index bd344253af3..a447021214f 100644 --- a/gcc/value-relation.cc +++ b/gcc/value-relation.cc @@ -667,8 +667,6 @@ private: inline void value_relation::set_relation (relation_kind r, tree n1, tree n2) { - gcc_checking_assert (SSA_NAME_VERSION (n1) != SSA_NAME_VERSION (n2) - || r == VREL_EQ); related = r; name1 = n1; name2 = n2; @@ -1449,6 +1447,11 @@ void path_oracle::register_relation (basic_block bb, relation_kind k, tree ssa1, tree ssa2) { + // If the 2 ssa_names are the same, do nothing. An equivalence is implied, + // and no other relation makes sense. + if (ssa1 == ssa2) + return; + if (dump_file && (dump_flags & TDF_DETAILS)) { value_relation vr (k, ssa1, ssa2);