https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84593
Bug ID: 84593 Summary: internal compiler error: Segmentation fault (non_type_check()) Product: gcc Version: 8.0.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: vegard.nossum at gmail dot com Target Milestone: --- Input: struct a { int x; int c = 0; int &b; } c = {}; Output: $ xgcc -x c++ -std=c++14 -O3 -c - <stdin>:5:8: error: member 'a::b' is uninitialized reference <stdin>:5:8: internal compiler error: Segmentation fault 0x3138779 crash_signal /home/vegard/git/gcc/gcc/toplev.c:325 0x1414ec4 non_type_check(tree_node*, char const*, int, char const*) /home/vegard/git/gcc/gcc/tree.h:3310 0x1414ec4 picflag_from_initializer /home/vegard/git/gcc/gcc/cp/typeck2.c:1230 0x141b813 process_init_constructor_record /home/vegard/git/gcc/gcc/cp/typeck2.c:1531 0x141b813 process_init_constructor /home/vegard/git/gcc/gcc/cp/typeck2.c:1712 0x141b813 digest_init_r /home/vegard/git/gcc/gcc/cp/typeck2.c:1147 0x14279ca digest_init_flags(tree_node*, tree_node*, int, int) /home/vegard/git/gcc/gcc/cp/typeck2.c:1192 0x14279ca store_init_value(tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>**, int) /home/vegard/git/gcc/gcc/cp/typeck2.c:814 0xb44f78 check_initializer /home/vegard/git/gcc/gcc/cp/decl.c:6380 0xbd8b3e cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int) /home/vegard/git/gcc/gcc/cp/decl.c:7034 0xf9dd85 cp_parser_init_declarator /home/vegard/git/gcc/gcc/cp/parser.c:19665 0xfa2a97 cp_parser_simple_declaration /home/vegard/git/gcc/gcc/cp/parser.c:13009 0xfa8c88 cp_parser_block_declaration /home/vegard/git/gcc/gcc/cp/parser.c:12827 0xffb8d5 cp_parser_declaration /home/vegard/git/gcc/gcc/cp/parser.c:12724 0xff298b cp_parser_declaration_seq_opt /home/vegard/git/gcc/gcc/cp/parser.c:12600 0xff3fb3 cp_parser_translation_unit /home/vegard/git/gcc/gcc/cp/parser.c:4559 0xff3fb3 c_parse_file() /home/vegard/git/gcc/gcc/cp/parser.c:38820 0x15a0525 c_common_parse_file() /home/vegard/git/gcc/gcc/c-family/c-opts.c:1132 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. Version: xgcc (GCC) 8.0.1 20180204 (experimental) built from git fdae6180ad24fa6303fa046114f3e4b66b8db34d Version 7.3.0 don't seem to be affected AFAICS. gcc trunk on godbolt.org (8.0.1 20180227) gives: <source>:5:8: error: member 'a::b' is uninitialized reference } c = {}; ^ <source>:5:8: internal compiler error: Segmentation fault mmap: Invalid argument Please submit a full bug report, with preprocessed source if appropriate. See <https://gcc.gnu.org/bugs/> for instructions. Compiler returned: 1 Test case was reduced by C-Reduce.