* Fix ICE in insert_to_assembler_name_hash
@ 2014-12-15 6:22 Jan Hubicka
0 siblings, 0 replies; only message in thread
From: Jan Hubicka @ 2014-12-15 6:22 UTC (permalink / raw)
To: gcc-patches
Hi,
this patch fixes ICE in symbol_table::insert_to_assembler_name_hash in cases
where C++ FE produces a symbol but refuses to give it an assembler name (because
it is abstract but w/o abstract flag set).
Bootstrapped/regtested x86_64-linux, comitted.
Index: ChangeLog
===================================================================
--- ChangeLog (revision 218727)
+++ ChangeLog (working copy)
@@ -1,5 +1,11 @@
2014-12-14 Jan Hubicka <hubicka@ucw.cz>
+ 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 <hubicka@ucw.cz>
+
* cgraphunit.c (analyze_functions): Always analyze targets of aliases.
2014-12-14 Jan Hubicka <hubicka@ucw.cz>
Index: testsuite/g++.dg/torture/pr61558.C
===================================================================
--- testsuite/g++.dg/torture/pr61558.C (revision 0)
+++ testsuite/g++.dg/torture/pr61558.C (revision 0)
@@ -0,0 +1,6 @@
+// { dg-do compile }
+static __typeof 0 a __attribute__ ((__weakref__ ("")));
+template <typename> class A
+{
+ static __thread int b;
+};
Index: testsuite/ChangeLog
===================================================================
--- testsuite/ChangeLog (revision 218727)
+++ testsuite/ChangeLog (working copy)
@@ -1,4 +1,9 @@
-2014-12-14 Jan HUbicka <hubicka@ucw.cz>
+2014-12-14 Jan Hubicka <hubicka@ucw.cz>
+
+ PR ipa/61558
+ * g++.dg/torture/pr61558.C: New testcase.
+
+2014-12-14 Jan Hubicka <hubicka@ucw.cz>
PR lto/64043
* g++.dg/lto/pr64043_0.C: New testcase.
Index: symtab.c
===================================================================
--- symtab.c (revision 218726)
+++ symtab.c (working copy)
@@ -168,6 +168,11 @@ symbol_table::insert_to_assembler_name_h
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
{
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);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-12-15 3:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-15 6:22 Fix ICE in insert_to_assembler_name_hash Jan Hubicka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).