From: Jan Hubicka Date: Mon, 15 Dec 2014 03:44:58 +0000 (+0100) Subject: re PR middle-end/61558 (ICE: Segmentation fault) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=59b5b46686c45c803118ad4dee42d8919e305bc0;p=gcc.git re PR middle-end/61558 (ICE: Segmentation fault) PR ipa/61558 * symtab.c (symbol_table::insert_to_assembler_name_hash symbol_table::unlink_from_assembler_name_hash): Do not ICE when DECL_ASSEMBLER_NAME is NULL. From-SVN: r218729 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1c637f6a415..253db82911e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2014-12-14 Jan Hubicka + + PR ipa/61558 + * symtab.c (symbol_table::insert_to_assembler_name_hash + symbol_table::unlink_from_assembler_name_hash): Do not ICE when + DECL_ASSEMBLER_NAME is NULL. + 2014-12-14 Jan Hubicka * cgraphunit.c (analyze_functions): Always analyze targets of aliases. diff --git a/gcc/symtab.c b/gcc/symtab.c index 101bc25ac41..37e4a94cf22 100644 --- a/gcc/symtab.c +++ b/gcc/symtab.c @@ -168,6 +168,11 @@ symbol_table::insert_to_assembler_name_hash (symtab_node *node, tree name = DECL_ASSEMBLER_NAME (node->decl); + /* C++ FE can produce decls without associated assembler name and insert + them to symtab to hold section or TLS information. */ + if (!name) + return; + hashval_t hash = decl_assembler_name_hash (name); aslot = assembler_name_hash->find_slot_with_hash (name, hash, INSERT); gcc_assert (*aslot != node); @@ -209,6 +214,10 @@ symbol_table::unlink_from_assembler_name_hash (symtab_node *node, { tree name = DECL_ASSEMBLER_NAME (node->decl); symtab_node **slot; + + if (!name) + return; + hashval_t hash = decl_assembler_name_hash (name); slot = assembler_name_hash->find_slot_with_hash (name, hash, NO_INSERT); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index bc4e0da32ec..95927472483 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,4 +1,9 @@ -2014-12-14 Jan HUbicka +2014-12-14 Jan Hubicka + + PR ipa/61558 + * g++.dg/torture/pr61558.C: New testcase. + +2014-12-14 Jan Hubicka PR lto/64043 * g++.dg/lto/pr64043_0.C: New testcase. diff --git a/gcc/testsuite/g++.dg/torture/pr61558.C b/gcc/testsuite/g++.dg/torture/pr61558.C new file mode 100644 index 00000000000..1e398e9155f --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr61558.C @@ -0,0 +1,6 @@ +// { dg-do compile } +static __typeof 0 a __attribute__ ((__weakref__ (""))); +template class A +{ + static __thread int b; +};