This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/69290] New: g++ ICE (segfault) on x86_64-linux-gnu


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

            Bug ID: 69290
           Summary: g++ ICE (segfault) on x86_64-linux-gnu
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following code causes an ICE (segfault) when compiled with the current g++
trunk on x86_64-linux-gnu in 64-bit mode. The 32-bit mode is OK.


$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20160114 (experimental) [trunk revision 232363] (GCC)


$ g++-trunk -c -m64 abc.cc
abc.cc:1:20: error: flexible array member 'str::x' in an otherwise empty
'struct str'
 struct str { int x[];};
                    ^

abc.cc:1:8: note: in the definition of 'struct str'
 struct str { int x[];};
        ^~~

abc.cc: In function 'void fun1()':
abc.cc:4:22: error: invalid conversion from 'const char*' to 'int'
[-fpermissive]
   struct str a = {"c"};
                      ^

abc.cc:4:22: internal compiler error: Segmentation fault
0xd04e9f crash_signal
        ../../gcc/gcc/toplev.c:334
0x7d764c non_type_check(tree_node*, char const*, int, char const*)
        ../../gcc/gcc/tree.h:3176
0x7d764c array_of_runtime_bound_p(tree_node*)
        ../../gcc/gcc/cp/tree.c:942
0x6c2303 split_nonconstant_init_1
        ../../gcc/gcc/cp/typeck2.c:604
0x6c1fe6 split_nonconstant_init_1
        ../../gcc/gcc/cp/typeck2.c:640
0x6c58aa split_nonconstant_init(tree_node*, tree_node*)
        ../../gcc/gcc/cp/typeck2.c:743
0x62dd62 check_initializer
        ../../gcc/gcc/cp/decl.c:6137
0x64c66c cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
        ../../gcc/gcc/cp/decl.c:6765
0x74ff88 cp_parser_init_declarator
        ../../gcc/gcc/cp/parser.c:18607
0x75062e cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:12330
0x750ad4 cp_parser_block_declaration
        ../../gcc/gcc/cp/parser.c:12206
0x751b58 cp_parser_declaration_statement
        ../../gcc/gcc/cp/parser.c:11818
0x7298ba cp_parser_statement
        ../../gcc/gcc/cp/parser.c:10500
0x72a171 cp_parser_statement_seq_opt
        ../../gcc/gcc/cp/parser.c:10778
0x72a273 cp_parser_compound_statement
        ../../gcc/gcc/cp/parser.c:10732
0x74e6a0 cp_parser_function_body
        ../../gcc/gcc/cp/parser.c:20600
0x74e6a0 cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc/gcc/cp/parser.c:20636
0x74f3bf cp_parser_function_definition_after_declarator
        ../../gcc/gcc/cp/parser.c:25263
0x7502f1 cp_parser_function_definition_from_specifiers_and_declarator
        ../../gcc/gcc/cp/parser.c:25175
0x7502f1 cp_parser_init_declarator
        ../../gcc/gcc/cp/parser.c:18378
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.



--------
$ cat abc.cc
struct str { int x[];};
void fun1 ()
{
  struct str a = {"c"};
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]