diff options
author | Andrew MacLeod <amacleod@redhat.com> | 2021-06-24 11:13:47 -0400 |
---|---|---|
committer | Andrew MacLeod <amacleod@redhat.com> | 2021-06-24 13:25:58 -0400 |
commit | ce0b409f562cd09c67cc2dce74143a0f0647cde5 (patch) | |
tree | b9e675f285a469a8d9f831a95cf27b303579df82 | |
parent | 5bdcfb74ff97b42f08993af8614c35685fdd8689 (diff) | |
download | gcc-ce0b409f562cd09c67cc2dce74143a0f0647cde5.zip gcc-ce0b409f562cd09c67cc2dce74143a0f0647cde5.tar.gz gcc-ce0b409f562cd09c67cc2dce74143a0f0647cde5.tar.bz2 |
Fix relation query of equivalences.
When looking for relations between equivalencies, a typo was causing
the wrong bitmap to be checked. Effect was is missed them.
Plus don't dump blocks which don't exist.
* value-relation.cc (equiv_oracle::dump): Do not dump NULL blocks.
(relation_oracle::find_relation_block): Check correct bitmap.
(relation_oracle::dump): Do not dump NULL blocks.
-rw-r--r-- | gcc/value-relation.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gcc/value-relation.cc b/gcc/value-relation.cc index 3c8698f..43fcab7 100644 --- a/gcc/value-relation.cc +++ b/gcc/value-relation.cc @@ -444,7 +444,7 @@ equiv_oracle::dump (FILE *f) const { fprintf (f, "Equivalency dump\n"); for (unsigned i = 0; i < m_equiv.length (); i++) - if (m_equiv[i]) + if (m_equiv[i] && BASIC_BLOCK_FOR_FN (cfun, i)) { fprintf (f, "BB%d\n", i); dump (f, BASIC_BLOCK_FOR_FN (cfun, i)); @@ -757,9 +757,9 @@ relation_oracle::find_relation_block (unsigned bb, const_bitmap b1, { unsigned op1 = SSA_NAME_VERSION (ptr->op1 ()); unsigned op2 = SSA_NAME_VERSION (ptr->op2 ()); - if (bitmap_bit_p (b1, op1) && bitmap_bit_p (b1, op2)) + if (bitmap_bit_p (b1, op1) && bitmap_bit_p (b2, op2)) return ptr->kind (); - if (bitmap_bit_p (b1, op2) && bitmap_bit_p (b1, op1)) + if (bitmap_bit_p (b1, op2) && bitmap_bit_p (b2, op1)) return relation_swap (ptr->kind ()); } @@ -925,8 +925,9 @@ relation_oracle::dump (FILE *f) const { fprintf (f, "Relation dump\n"); for (unsigned i = 0; i < m_relations.length (); i++) - { - fprintf (f, "BB%d\n", i); - dump (f, BASIC_BLOCK_FOR_FN (cfun, i)); - } + if (BASIC_BLOCK_FOR_FN (cfun, i)) + { + fprintf (f, "BB%d\n", i); + dump (f, BASIC_BLOCK_FOR_FN (cfun, i)); + } } |