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

            Bug ID: 61723
           Summary: [C++11] ICE in contains_struct_check
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ppluzhnikov at google dot com

Google ref: b/16030670.

AFAICT, this is broken in all of 4.7 / 4.8 / 4.9 / 4.10.
Accepted by Clang without warnings.

gcc-svn-r212277/bin/g++ -c -std=c++11 t.cc
t.cc: In function ‘void fn1()’:
t.cc:29:14: internal compiler error: Segmentation fault
     spec.dim = { };
              ^
0xb8527f crash_signal
    ../../gcc/toplev.c:337
0x557b81 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
    ../../gcc/tree.h:2844
0x557b81 convert_like_real
    ../../gcc/cp/call.c:6257
0x554eab build_over_call
    ../../gcc/cp/call.c:7162
0x55800b convert_like_real
    ../../gcc/cp/call.c:6160
0x55799b convert_like_real
    ../../gcc/cp/call.c:6290
0x554eab build_over_call
    ../../gcc/cp/call.c:7162
0x56785c build_new_op_1
    ../../gcc/cp/call.c:5513
0x567c4e build_new_op(unsigned int, tree_code, int, tree_node*, tree_node*,
tree_node*, tree_node**, int)
    ../../gcc/cp/call.c:5674
0x6a6aeb cp_build_modify_expr(tree_node*, tree_code, tree_node*, int)
    ../../gcc/cp/typeck.c:7399
0x669632 cp_parser_assignment_expression
    ../../gcc/cp/parser.c:8216
0x66b8a3 cp_parser_expression
    ../../gcc/cp/parser.c:8342
0x66c0cc cp_parser_expression
    ../../gcc/cp/parser.c:8381
0x66c0cc cp_parser_expression_statement
    ../../gcc/cp/parser.c:9720
0x660e98 cp_parser_statement
    ../../gcc/cp/parser.c:9571
0x661ca9 cp_parser_statement_seq_opt
    ../../gcc/cp/parser.c:9843
0x661e16 cp_parser_compound_statement
    ../../gcc/cp/parser.c:9797
0x67319b cp_parser_function_body
    ../../gcc/cp/parser.c:18872
0x67319b cp_parser_ctor_initializer_opt_and_function_body
    ../../gcc/cp/parser.c:18908
0x679883 cp_parser_function_definition_after_declarator
    ../../gcc/cp/parser.c:23044
Please submit a full bug report,
with preprocessed source if appropriate.


gcc-svn-r212277/bin/g++ -c -std=c++11 t.cc -DBUG1
t.cc: In function ‘void fn1()’:
t.cc:26:1: error: non-trivial conversion at assignment
 fn1 ()
 ^
int
const int[0:18446744073709551615] *
D.2173._M_len = &._0;
t.cc:26:1: internal compiler error: verify_gimple failed
0xbb49ff verify_gimple_in_seq(gimple_statement_base*)
    ../../gcc/tree-cfg.c:4665
0x9cb6c1 gimplify_body(tree_node*, bool)
    ../../gcc/gimplify.c:8848
0x9cba26 gimplify_function_tree(tree_node*)
    ../../gcc/gimplify.c:8933
0x84be17 analyze_function
    ../../gcc/cgraphunit.c:650
0x84d01f analyze_functions
    ../../gcc/cgraphunit.c:1028
0x84e8e5 finalize_compilation_unit()
    ../../gcc/cgraphunit.c:2331
0x63b07e cp_write_global_declarations()
    ../../gcc/cp/decl2.c:4652
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.


// -- cut ---
namespace std {
  template < class > struct initializer_list
  {
#if BUG1
    int _M_len;
#endif
    const int *begin ();
    const int *end ();
  };
}

struct J
{
    J (const int &);
    template < typename InputIterator > J (InputIterator, InputIterator);
    J (std::initializer_list < int >p1):J (p1.begin (), p1.end ()) { }
};

struct L
{
    L ():dim (0) { }
    J dim;
};

void
fn1 ()
{
    L spec;
    spec.dim = { };
}
// --- cut ---

Reply via email to