From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4218 invoked by alias); 9 Oct 2013 20:52:34 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 4194 invoked by uid 48); 9 Oct 2013 20:52:31 -0000 From: "reichelt at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/58671] New: ICE with thread_local and self-referential variable initialization Date: Wed, 09 Oct 2013 20:52:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: reichelt at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-10/txt/msg00512.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58671 Bug ID: 58671 Summary: ICE with thread_local and self-referential variable initialization Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: reichelt at gcc dot gnu.org The following valid code line(compiled with "-std=c++11") triggers an ICE since GCC 4.8.0 (when thread_local was introduced): ============================== thread_local int i = i; ============================== bug.cc:1:22: internal compiler error: in var_defined_without_dynamic_init, at cp/decl2.c:2836 thread_local int i = i; ^ 0x60966a var_defined_without_dynamic_init ../../gcc/gcc/cp/decl2.c:2836 0x60966a var_needs_tls_wrapper ../../gcc/gcc/cp/decl2.c:2852 0x6164db get_tls_wrapper_fn(tree_node*) ../../gcc/gcc/cp/decl2.c:2950 0x6b612f finish_id_expression(tree_node*, tree_node*, tree_node*, cp_id_kind*, bool, bool, bool*, bool, bool, bool, bool, char const**, unsigned int) ../../gcc/gcc/cp/semantics.c:3387 0x63fc90 cp_parser_primary_expression ../../gcc/gcc/cp/parser.c:4539 0x641890 cp_parser_postfix_expression ../../gcc/gcc/cp/parser.c:5814 0x64405d cp_parser_unary_expression ../../gcc/gcc/cp/parser.c:7009 0x644c2f cp_parser_binary_expression ../../gcc/gcc/cp/parser.c:7701 0x6450ef cp_parser_assignment_expression ../../gcc/gcc/cp/parser.c:7937 0x645546 cp_parser_assignment_expression ../../gcc/gcc/cp/parser.c:7987 0x645546 cp_parser_constant_expression ../../gcc/gcc/cp/parser.c:8197 0x6512ae cp_parser_init_declarator ../../gcc/gcc/cp/parser.c:16530 0x65187f cp_parser_simple_declaration ../../gcc/gcc/cp/parser.c:10995 0x653700 cp_parser_block_declaration ../../gcc/gcc/cp/parser.c:10876 0x65c73e cp_parser_declaration ../../gcc/gcc/cp/parser.c:10773 0x65b4aa cp_parser_declaration_seq_opt ../../gcc/gcc/cp/parser.c:10659 0x65cd76 cp_parser_translation_unit ../../gcc/gcc/cp/parser.c:3939 0x65cd76 c_parse_file() ../../gcc/gcc/cp/parser.c:28911 0x770903 c_common_parse_file() ../../gcc/gcc/c-family/c-opts.c:1046 Please submit a full bug report, [etc.]