https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62299

            Bug ID: 62299
           Summary: [4.9/5 regression] ICE with
                    __attribute__((__weakref__(""))) and __thread
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lucdanton at free dot fr

$ g++-trunk --version
g++-trunk (GCC) 5.0.0 20140828 (experimental)
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ cat testcase.cpp
static __typeof 0 __gthrw_pthread_once __attribute__((__weakref__("")));
template <typename T> class keyword_tss_ptrnoncopyable {
  static __thread T *value_;
};
$ g++-trunk testcase.cpp -c
testcase.cpp:4:2: internal compiler error: Segmentation fault
 };
  ^
0xc11bff crash_signal
    ../../gcc/gcc/toplev.c:339
0x8a49f4 tree_check
    ../../gcc/gcc/tree.h:2962
0x8a49f4 symbol_table::decl_assembler_name_hash(tree_node const*)
    ../../gcc/gcc/symtab.c:69
0x8a4c73 symbol_table::insert_to_assembler_name_hash(symtab_node*, bool)
    ../../gcc/gcc/symtab.c:181
0x8a4efc symbol_table::symtab_initialize_asm_name_hash()
    ../../gcc/gcc/symtab.c:263
0x8a6d6f symtab_node::get_for_asmname(tree_node const*)
    ../../gcc/gcc/symtab.c:947
0x8b2f38 handle_alias_pairs
    ../../gcc/gcc/cgraphunit.c:1111
0x8b7ddc symbol_table::finalize_compilation_unit()
    ../../gcc/gcc/cgraphunit.c:2264
0x69cde2 cp_write_global_declarations()
    ../../gcc/gcc/cp/decl2.c:4666
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

----------

This testcase was mechanically derived from preprocessed source. As best as I
can tell the original __gthrw_pthread_once comes from
c++/5.0.0/x86_64-unknown-linux-gnu/bits/gthr-default.h., in case that matters.

The testcase is accepted by GCC 4.8 and 4.9.

Reply via email to