]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Allow registering same SSA name relations in oracle.
authorAldy Hernandez <aldyh@redhat.com>
Wed, 20 Jul 2022 18:36:54 +0000 (20:36 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Sun, 24 Jul 2022 15:00:50 +0000 (17:00 +0200)
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.

gcc/value-relation.cc

index bd344253af316d48f4415f5292fe548e636df6aa..a447021214fff977ad2e423f3893bb416018afae 100644 (file)
@@ -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);