https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84665
Bug ID: 84665
Summary: internal compiler error: in build_value_init, at
cp/init.c:343
Product: gcc
Version: 8.0.1
Status: UNCONFIRMED
Keywords: ice-on-invalid-code
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: vegard.nossum at gmail dot com
CC: webrown.cpp at gmail dot com
Target Milestone: ---
Input:
struct {
} a[1];
template<int &&>
void b() {
__attribute__((noinline(a[0]))) int c = 0;
}
Output:
$ xgcc -x c++ -S -
<stdin>: In function 'void b()':
<stdin>:6:38: internal compiler error: in build_value_init, at cp/init.c:343
0xcfbe2b build_value_init(tree_node*, int)
/home/vegard/git/gcc/gcc/cp/init.c:342
0xa47056 cxx_eval_array_reference
/home/vegard/git/gcc/gcc/cp/constexpr.c:2458
0xa339b0 cxx_eval_constant_expression
/home/vegard/git/gcc/gcc/cp/constexpr.c:4470
0xa4e0da cxx_eval_outermost_constant_expr
/home/vegard/git/gcc/gcc/cp/constexpr.c:4827
0xa5b966 maybe_constant_value(tree_node*, tree_node*)
/home/vegard/git/gcc/gcc/cp/constexpr.c:5044
0xc43ac2 cp_check_const_attributes
/home/vegard/git/gcc/gcc/cp/decl2.c:1415
0xc43ac2 cplus_decl_attributes(tree_node**, tree_node*, int)
/home/vegard/git/gcc/gcc/cp/decl2.c:1531
0xc1974a start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
/home/vegard/git/gcc/gcc/cp/decl.c:5050
0xfa391c cp_parser_init_declarator
/home/vegard/git/gcc/gcc/cp/parser.c:19591
0xfa9757 cp_parser_simple_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:13063
0xfaf948 cp_parser_block_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:12881
0xfb1e14 cp_parser_declaration_statement
/home/vegard/git/gcc/gcc/cp/parser.c:12474
0xefdd8b cp_parser_statement
/home/vegard/git/gcc/gcc/cp/parser.c:10923
0xf0184b cp_parser_statement_seq_opt
/home/vegard/git/gcc/gcc/cp/parser.c:11272
0xf022ea cp_parser_compound_statement
/home/vegard/git/gcc/gcc/cp/parser.c:11226
0xf967eb cp_parser_function_body
/home/vegard/git/gcc/gcc/cp/parser.c:21769
0xf967eb cp_parser_ctor_initializer_opt_and_function_body
/home/vegard/git/gcc/gcc/cp/parser.c:21804
0xf9f9f5 cp_parser_function_definition_after_declarator
/home/vegard/git/gcc/gcc/cp/parser.c:26809
0xfa604d cp_parser_function_definition_from_specifiers_and_declarator
/home/vegard/git/gcc/gcc/cp/parser.c:26726
0xfa604d cp_parser_init_declarator
/home/vegard/git/gcc/gcc/cp/parser.c:19493
$ xgcc --version
xgcc (GCC) 8.0.1 20180301 (experimental)
Built from git c435a9e730c6e8f10da09d58b4fc9aaeb401b0d5 (r258097).
Seems to have appeared between 6.3.0 and 7.1.0.
Test case was minimised by C-Reduce.