summaryrefslogtreecommitdiff
path: root/gcc/cgraph.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2019-03-07 16:33:52 +0100
committerMartin Liska <marxin@gcc.gnu.org>2019-03-07 15:33:52 +0000
commit606711a1671cc63713b893c4557df967a5a6ac20 (patch)
treefd2183289f3e715a297915d890a8581a5d771fa4 /gcc/cgraph.c
parent7c3f98ca6567d5b12d28421a4a3deec3b9c52efc (diff)
Significantly speed up verifiers for a cgraph_node with many clones.
2019-03-07 Martin Liska <mliska@suse.cz> * cgraph.c (cgraph_node::verify_node): Verify with a neighbour which is equivalent to searching for this in clones chain. * symtab.c (symtab_node::verify_base): Similarly compare ASM names with a neighbour and special case first node in a chain. From-SVN: r269461
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r--gcc/cgraph.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index de82316d4b1..dfe1833ed1d 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -3240,14 +3240,14 @@ cgraph_node::verify_node (void)
if (clone_of)
{
- cgraph_node *n;
- for (n = clone_of->clones; n; n = n->next_sibling_clone)
- if (n == this)
- break;
- if (!n)
+ cgraph_node *first_clone = clone_of->clones;
+ if (first_clone != this)
{
- error ("cgraph_node has wrong clone_of");
- error_found = true;
+ if (prev_sibling_clone->clone_of != clone_of)
+ {
+ error ("cgraph_node has wrong clone_of");
+ error_found = true;
+ }
}
}
if (clones)