https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65531
ienkovich at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hubicka at gcc dot gnu.org --- Comment #1 from ienkovich at gcc dot gnu.org --- same_comdat_group verification loop looks weird. for (s = (*entry)->same_comdat_group; s != NULL && s != node; s = s->same_comdat_group) if (!s || s == *entry) The '!s' condition has no chance to work due to 's != NULL' condition. Thus verifier doesn't catch cases when there are two nodes with the same comdat group not actually linked with same_comdat_group. Is it expected behavior? With a verifier patch applied I have this test failed with no '-fcheck-pointer-bounds -mmpx': diff --git a/gcc/symtab.c b/gcc/symtab.c index 88e168b..395cfe4 100644 --- a/gcc/symtab.c +++ b/gcc/symtab.c @@ -1131,7 +1131,7 @@ symtab_node::verify_symtab_nodes (void) if (!existed) *entry = node; else - for (s = (*entry)->same_comdat_group; s != NULL && s != node; s = s->same_comdat_group) + for (s = (*entry)->same_comdat_group; s != node; s = s->same_comdat_group) if (!s || s == *entry) { error ("Two symbols with same comdat_group are not linked by the same_comdat_group list.");