From: Andrew MacLeod Date: Fri, 14 Oct 2022 18:31:02 +0000 (-0400) Subject: Don't set useless relations. X-Git-Tag: basepoints/gcc-14~3876 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fca529517484bf19098ca9efa77e95534086abdc;p=thirdparty%2Fgcc.git Don't set useless relations. The oracle will not register nonssense/useless relations, class value_relation shouldn't either. * value-relation.cc (value_relation::dump): Change message. * value-relation.h (value_relation::set_relation): If op1 is the same as op2 do not create a relation. --- diff --git a/gcc/value-relation.cc b/gcc/value-relation.cc index 50fc190a36b2..3fb7b96c9e0a 100644 --- a/gcc/value-relation.cc +++ b/gcc/value-relation.cc @@ -891,7 +891,7 @@ value_relation::dump (FILE *f) const { if (!name1 || !name2) { - fprintf (f, "uninitialized"); + fprintf (f, "no relation registered"); return; } fputc ('(', f); diff --git a/gcc/value-relation.h b/gcc/value-relation.h index a3bbe1e8157b..fa9097a8069c 100644 --- a/gcc/value-relation.h +++ b/gcc/value-relation.h @@ -349,6 +349,13 @@ value_relation::set_relation (relation_kind r, tree n1, tree n2) { gcc_checking_assert (TREE_CODE (n1) == SSA_NAME && TREE_CODE (n2) == SSA_NAME); + if (n1 == n2) + { + related = VREL_VARYING; + name1 = NULL_TREE; + name2 = NULL_TREE; + return; + } related = r; name1 = n1; name2 = n2;