Commit 606711a1 by Martin Liska Committed by Martin Liska

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
parent 7c3f98ca
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.
2019-01-25 Jason Merrill <jason@redhat.com> 2019-01-25 Jason Merrill <jason@redhat.com>
PR c++/80916 - spurious "static but not defined" warning. PR c++/80916 - spurious "static but not defined" warning.
......
...@@ -3240,14 +3240,14 @@ cgraph_node::verify_node (void) ...@@ -3240,14 +3240,14 @@ cgraph_node::verify_node (void)
if (clone_of) if (clone_of)
{ {
cgraph_node *n; cgraph_node *first_clone = clone_of->clones;
for (n = clone_of->clones; n; n = n->next_sibling_clone) if (first_clone != this)
if (n == this)
break;
if (!n)
{ {
error ("cgraph_node has wrong clone_of"); if (prev_sibling_clone->clone_of != clone_of)
error_found = true; {
error ("cgraph_node has wrong clone_of");
error_found = true;
}
} }
} }
if (clones) if (clones)
......
...@@ -1040,23 +1040,30 @@ symtab_node::verify_base (void) ...@@ -1040,23 +1040,30 @@ symtab_node::verify_base (void)
if (symtab->assembler_name_hash) if (symtab->assembler_name_hash)
{ {
hashed_node = symtab_node::get_for_asmname (DECL_ASSEMBLER_NAME (decl)); hashed_node = symtab_node::get_for_asmname (DECL_ASSEMBLER_NAME (decl));
if (hashed_node && hashed_node->previous_sharing_asm_name) if (hashed_node)
{ {
error ("assembler name hash list corrupted"); if (hashed_node->previous_sharing_asm_name)
error_found = true; {
} error ("assembler name hash list corrupted");
while (hashed_node) error_found = true;
{ }
if (hashed_node == this) else if (previous_sharing_asm_name == NULL)
break; {
hashed_node = hashed_node->next_sharing_asm_name; if (hashed_node != this)
} {
if (!hashed_node error ("assembler name hash list corrupted");
&& !(is_a <varpool_node *> (this) error_found = true;
&& DECL_HARD_REGISTER (decl))) }
{ }
error ("node not found in symtab assembler name hash"); else if (!(is_a <varpool_node *> (this) && DECL_HARD_REGISTER (decl)))
error_found = true; {
if (!asmname_hasher::equal (previous_sharing_asm_name,
DECL_ASSEMBLER_NAME (decl)))
{
error ("node not found in symtab assembler name hash");
error_found = true;
}
}
} }
} }
if (previous_sharing_asm_name if (previous_sharing_asm_name
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment