From b7e85ee1070cecffe7dc6b722b67afd758663fb2 Mon Sep 17 00:00:00 2001 From: Ilya Enkovich Date: Tue, 31 Mar 2015 08:29:28 +0000 Subject: [PATCH] re PR target/65531 (ICE: symtab_node::verify failed: Two symbols with same comdat_group are not linked by the same_comdat_group list. with -fcheck-pointer-bounds -mmpx) gcc/ PR target/65531 * ipa-chkp.c (chkp_maybe_create_clone): Don't set same_comdat_group for external symbols. * symtab.c (symtab_node::verify_symtab_nodes): Avoid infinite same_comdat_group traversal loop. gcc/testsuite/ PR target/65531 * gcc.target/i386/mpx/pr65531.cc: New. From-SVN: r221788 --- gcc/ChangeLog | 8 ++++++++ gcc/ipa-chkp.c | 3 ++- gcc/symtab.c | 3 ++- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/i386/mpx/pr65531.cc | 13 +++++++++++++ 5 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/mpx/pr65531.cc diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 23213eeb515..189c3d8f3aa 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2015-03-31 Ilya Enkovich + + PR target/65531 + * ipa-chkp.c (chkp_maybe_create_clone): Don't set + same_comdat_group for external symbols. + * symtab.c (symtab_node::verify_symtab_nodes): Avoid + infinite same_comdat_group traversal loop. + 2015-03-31 Jakub Jelinek PR plugins/61176 diff --git a/gcc/ipa-chkp.c b/gcc/ipa-chkp.c index a9933e237c4..3218d42330e 100644 --- a/gcc/ipa-chkp.c +++ b/gcc/ipa-chkp.c @@ -574,7 +574,8 @@ chkp_maybe_create_clone (tree fndecl) /* Clones have the same comdat group as originals. */ if (node->same_comdat_group - || DECL_ONE_ONLY (node->decl)) + || (DECL_ONE_ONLY (node->decl) + && !DECL_EXTERNAL (node->decl))) clone->add_to_same_comdat_group (node); if (gimple_has_body_p (fndecl)) diff --git a/gcc/symtab.c b/gcc/symtab.c index eb41d62a969..156fa3d9f28 100644 --- a/gcc/symtab.c +++ b/gcc/symtab.c @@ -1132,7 +1132,8 @@ symtab_node::verify_symtab_nodes (void) *entry = node; else if (!DECL_EXTERNAL (node->decl)) { - for (s = (*entry)->same_comdat_group; s != NULL && s != node; + for (s = (*entry)->same_comdat_group; + s != NULL && s != node && s != *entry; s = s->same_comdat_group) ; if (!s || s == *entry) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 04b5fadb94d..de247ed4446 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-03-31 Ilya Enkovich + + PR target/65531 + * gcc.target/i386/mpx/pr65531.cc: New. + 2015-03-31 Ilya Enkovich PR target/65602 diff --git a/gcc/testsuite/gcc.target/i386/mpx/pr65531.cc b/gcc/testsuite/gcc.target/i386/mpx/pr65531.cc new file mode 100644 index 00000000000..049569c50b1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/mpx/pr65531.cc @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fcheck-pointer-bounds -mmpx" } */ + +#pragma interface + +struct S +{ + ~S () + { + } +}; + +S s; -- 2.30.2