aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2021-08-26 21:37:46 +0200
committerJan Hubicka <hubicka@ucw.cz>2021-08-26 21:37:46 +0200
commit352d5e85a7060cd0e069d81c61b22ca3d16ffc49 (patch)
treef456a844800fea1c8b3e39a977d4f1c36edb9f97
parente2693a72701fe55995c0cca5a014b733a9f0aa64 (diff)
downloadgcc-352d5e85a7060cd0e069d81c61b22ca3d16ffc49.zip
gcc-352d5e85a7060cd0e069d81c61b22ca3d16ffc49.tar.gz
gcc-352d5e85a7060cd0e069d81c61b22ca3d16ffc49.tar.bz2
Fix ipa-modref verification ices
* ipa-modref-tree.h (modref_access_node::try_merge_with): Restart search after merging.
-rw-r--r--gcc/ipa-modref-tree.h33
1 files changed, 24 insertions, 9 deletions
diff --git a/gcc/ipa-modref-tree.h b/gcc/ipa-modref-tree.h
index 97934a9..a86e684 100644
--- a/gcc/ipa-modref-tree.h
+++ b/gcc/ipa-modref-tree.h
@@ -405,20 +405,35 @@ private:
void
try_merge_with (size_t index)
{
- modref_access_node *a2;
size_t i;
- FOR_EACH_VEC_SAFE_ELT (accesses, i, a2)
- if (i != index
- && ((*accesses)[index].contains (*a2)
- || (*accesses)[index].merge (*a2, false)))
+ for (i = 0; i < accesses->length ();)
+ if (i != index)
{
- accesses->unordered_remove (i);
- if (index == accesses->length ())
- index = i;
+ bool found = false, restart = false;
+ modref_access_node *a = &(*accesses)[i];
+ modref_access_node *n = &(*accesses)[index];
+
+ if (n->contains (*a))
+ found = true;
+ if (!found && n->merge (*a, false))
+ found = restart = true;
+ if (found)
+ {
+ accesses->unordered_remove (i);
+ if (index == accesses->length ())
+ {
+ index = i;
+ i++;
+ }
+ if (restart)
+ i = 0;
+ }
else
- i--;
+ i++;
}
+ else
+ i++;
}
};