aboutsummaryrefslogtreecommitdiff
path: root/gcc/symtab.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/symtab.c
parent7c3f98ca6567d5b12d28421a4a3deec3b9c52efc (diff)
downloadgcc-606711a1671cc63713b893c4557df967a5a6ac20.zip
gcc-606711a1671cc63713b893c4557df967a5a6ac20.tar.gz
gcc-606711a1671cc63713b893c4557df967a5a6ac20.tar.bz2
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/symtab.c')
-rw-r--r--gcc/symtab.c39
1 files changed, 23 insertions, 16 deletions
diff --git a/gcc/symtab.c b/gcc/symtab.c
index c9fa16b..16a2135 100644
--- a/gcc/symtab.c
+++ b/gcc/symtab.c
@@ -1040,23 +1040,30 @@ symtab_node::verify_base (void)
if (symtab->assembler_name_hash)
{
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");
- error_found = true;
- }
- while (hashed_node)
- {
- if (hashed_node == this)
- break;
- hashed_node = hashed_node->next_sharing_asm_name;
- }
- if (!hashed_node
- && !(is_a <varpool_node *> (this)
- && DECL_HARD_REGISTER (decl)))
- {
- error ("node not found in symtab assembler name hash");
- error_found = true;
+ if (hashed_node->previous_sharing_asm_name)
+ {
+ error ("assembler name hash list corrupted");
+ error_found = true;
+ }
+ else if (previous_sharing_asm_name == NULL)
+ {
+ if (hashed_node != this)
+ {
+ error ("assembler name hash list corrupted");
+ error_found = true;
+ }
+ }
+ else if (!(is_a <varpool_node *> (this) && DECL_HARD_REGISTER (decl)))
+ {
+ 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