From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1ED5E3858D3C; Tue, 17 May 2022 18:46:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1ED5E3858D3C From: "gscfq@t-online.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/105634] New: ICE: Floating point exception in maybe_warn_class_memaccess Date: Tue, 17 May 2022 18:46:57 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: gscfq@t-online.de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2022 18:46:58 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105634 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: gscfq@t-online.de Target Milestone: --- Started with r8 : $ cat z1.cc struct s { struct {} a[] =3D 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 'stru= ct s' 3 | struct {} a[] =3D 1.0; | ^ z1.cc:3:13: error: initializer for flexible array member 's:: 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**, int) ../../gcc/cp/call.cc:4847 0x9ecc5e finish_call_expr(tree_node*, vec**, b= ool, 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=