re PR target/65531 (ICE: symtab_node::verify failed: Two symbols with same comdat_gro...
authorIlya Enkovich <ilya.enkovich@intel.com>
Tue, 31 Mar 2015 08:29:28 +0000 (08:29 +0000)
committerIlya Enkovich <ienkovich@gcc.gnu.org>
Tue, 31 Mar 2015 08:29:28 +0000 (08:29 +0000)
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
gcc/ipa-chkp.c
gcc/symtab.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/mpx/pr65531.cc [new file with mode: 0644]

index 23213eeb5158cdf8deba860fc73a3676916bb151..189c3d8f3aaa0bc170a6d0fc9e8f9cbf212551f6 100644 (file)
@@ -1,3 +1,11 @@
+2015-03-31  Ilya Enkovich  <ilya.enkovich@intel.com>
+
+       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  <jakub@redhat.com>
 
        PR plugins/61176
index a9933e237c418fc14ffa0d076e2222afc2733570..3218d42330e14c647413916f705b9987f3d70e9f 100644 (file)
@@ -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))
index eb41d62a96979ff8d7618e2782c3e78fb3130e36..156fa3d9f283ea3aeda57494603a278844253809 100644 (file)
@@ -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)
index 04b5fadb94db10006afae37d7a602e7249efcbb9..de247ed4446e1041f68a7fb5b764ad561f5dc8da 100644 (file)
@@ -1,3 +1,8 @@
+2015-03-31  Ilya Enkovich  <ilya.enkovich@intel.com>
+
+       PR target/65531
+       * gcc.target/i386/mpx/pr65531.cc: New.
+
 2015-03-31  Ilya Enkovich  <ilya.enkovich@intel.com>
 
        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 (file)
index 0000000..049569c
--- /dev/null
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fcheck-pointer-bounds -mmpx" } */
+
+#pragma interface
+
+struct S
+{
+  ~S ()
+  {
+  }
+};
+
+S s;