https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105634
Bug ID: 105634
Summary: ICE: Floating point exception in
maybe_warn_class_memaccess
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: [email protected]
Target Milestone: ---
Started with r8 :
$ cat z1.cc
struct s
{
struct {} a[] = 1.0;
void f (char *c)
{
s s;
__builtin_memcpy (&s, c, sizeof(s));
}
};
$ g++-13-20220515 -c z1.cc -Wall
z1.cc:3:13: error: flexible array member 's::a' in an otherwise empty 'struct
s'
3 | struct {} a[] = 1.0;
| ^
z1.cc:3:13: error: initializer for flexible array member 's::<unnamed struct>
s::a []'
z1.cc: In member function 'void s::f(char*)':
z1.cc:7:22: internal compiler error: Floating point exception
7 | __builtin_memcpy (&s, c, sizeof(s));
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
0x10da4cf crash_signal
../../gcc/toplev.cc:322
0x736147 maybe_warn_class_memaccess
../../gcc/cp/call.cc:10332
0x736147 build_over_call
../../gcc/cp/call.cc:9880
0x736a87 build_new_function_call(tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
../../gcc/cp/call.cc:4847
0x9ecc5e finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
../../gcc/cp/semantics.cc:2895
0x91b288 cp_parser_postfix_expression
../../gcc/cp/parser.cc:7888
0x932a91 cp_parser_unary_expression
../../gcc/cp/parser.cc:9037
0x90017f cp_parser_cast_expression
../../gcc/cp/parser.cc:9941
0x900a41 cp_parser_binary_expression
../../gcc/cp/parser.cc:10043
0x901470 cp_parser_assignment_expression
../../gcc/cp/parser.cc:10347
0x90315c cp_parser_expression
../../gcc/cp/parser.cc:10517
0x906597 cp_parser_expression_statement
../../gcc/cp/parser.cc:12734
0x916ab4 cp_parser_statement
../../gcc/cp/parser.cc:12526
0x917c94 cp_parser_statement_seq_opt
../../gcc/cp/parser.cc:12883
0x917d77 cp_parser_compound_statement
../../gcc/cp/parser.cc:12835
0x93ea00 cp_parser_function_body
../../gcc/cp/parser.cc:25186
0x93ea00 cp_parser_ctor_initializer_opt_and_function_body
../../gcc/cp/parser.cc:25237
0x93f07a cp_parser_function_definition_after_declarator
../../gcc/cp/parser.cc:31369
0x93f430 cp_parser_late_parsing_for_member
../../gcc/cp/parser.cc:32335
0x911802 cp_parser_class_specifier_1
../../gcc/cp/parser.cc:26305