From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BEAFD3858C78; Tue, 12 Dec 2023 22:40:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BEAFD3858C78 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1702420810; bh=CgvysO6ikxaXmbHhPfRdzK982XqQOP/dgZiEN18NDH4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=u1Yc2jE/wbOFvmwCHHK+rpTXjcdLslDG9xT6eV2l7EVbH62fj1H8ON9BN37w1ILXs Q4W+GkfBxZHa3oEDRZCPm01btPIwL3f6j0+5B2kBkASM7oe0VH0Ef0IkDMZOj0vFAi xwkx3o9kYlVKv6vM6Zw2vFkt5LLnDEZI85GQCyPU= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/112989] GC ICE with C++, `#include ` and `-fsanitize=address` Date: Tue, 12 Dec 2023 22:40:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: GC, ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW 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: cc Message-ID: In-Reply-To: References: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112989 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rsandifo at gcc dot gnu.org --- Comment #5 from Andrew Pinski --- Here is where the 2 builtins are added: ``` Breakpoint 1, aarch64_sve::function_builder::add_function (this=3D0x7ffffff= fd980, instance=3D..., name=3D0x31d4ca0 "svmla_za64_vg4x1", fntype=3D0x7ffff743493= 0, attrs=3D0x0, required_extensions=3D5497558138885, overloaded_p=3Dtrue, placeholder_p=3Dtrue) at ../../gcc/config/aarch64/aarch64-sve-builtins.cc:1= 478 1478 if (t !=3D 0) (gdb) bt #0 aarch64_sve::function_builder::add_function (this=3D0x7fffffffd980, instance=3D..., name=3D0x31d4ca0 "svmla_za64_vg4x1", fntype=3D0x7ffff743493= 0, attrs=3D0x0, required_extensions=3D5497558138885, overloaded_p=3Dtrue, placeholder_p=3Dtrue) at ../../gcc/config/aarch64/aarch64-sve-builtins.cc:1= 478 #1 0x00000000017ddeb5 in aarch64_sve::function_builder::add_overloaded_function (this=3D0x7fffffffd9= 80, instance=3D..., required_extensions=3D5497558138885) at ../../gcc/config/aarch64/aarch64-sve-builtins.cc:1581 #2 0x00000000017ddf7d in operator() (__closure=3D0x7fffffffd900, types=3D.= .., group_suffix_id=3Daarch64_sve::GROUP_vg4x1, pi=3D0) at ../../gcc/config/aarch64/aarch64-sve-builtins.cc:1604 #3 0x00000000017de087 in operator() (__closure=3D0x7fffffffd8d0, group_suffix_id=3Daarch64_sve::GROUP_vg4x1, pi=3D0) at ../../gcc/config/aarch64/aarch64-sve-builtins.cc:1628 #4 0x00000000017de1c4 in aarch64_sve::function_builder::add_overloaded_functions (this=3D0x7fffffffd= 980, group=3D..., mode=3Daarch64_sve::MODE_none) at ../../gcc/config/aarch64/aarch64-sve-builtins.cc:1635 #5 0x00000000017f483d in aarch64_sve::binary_za_slice_opt_single_def::build (this=3D, b=3D..., group=3D...) at ../../gcc/config/aarch64/aarch64-sve-builtins-shapes.cc:1894 #6 0x00000000017de25d in aarch64_sve::function_builder::register_function_group (this=3D0x7fffffffd9= 80, group=3D...) at ../../gcc/config/aarch64/aarch64-sve-builtins.cc:1644 #7 0x00000000017e771b in aarch64_sve::handle_arm_sve_h () at ../../gcc/config/aarch64/aarch64-sve-builtins.cc:4595 #8 0x0000000000da3d75 in aarch64_pragma_aarch64 () at ../../gcc/config/aarch64/aarch64-c.cc:347 #9 0x0000000000bf022f in cp_parser_pragma (parser=3D0x7ffff73409d8, context=3Dpragma_external, if_p=3D0x0) at ../../gcc/cp/parser.cc:50751 #10 0x0000000000c2c2ac in cp_parser_toplevel_declaration (parser=3D0x7ffff73409d8) at ../../gcc/cp/parser.cc:15392 #11 cp_parser_toplevel_declaration (parser=3D0x7ffff73409d8) at ../../gcc/cp/parser.cc:15383 #12 cp_parser_translation_unit (parser=3D0x7ffff73409d8) at ../../gcc/cp/parser.cc:5273 #13 c_parse_file () at ../../gcc/cp/parser.cc:50845 #14 0x0000000000d741d2 in c_common_parse_file () at ../../gcc/c-family/c-opts.cc:1301 #15 0x000000000133917e in compile_file () at ../../gcc/toplev.cc:446 #16 0x0000000000a4b151 in do_compile () at ../../gcc/toplev.cc:2150 #17 toplev::main (this=3Dthis@entry=3D0x7fffffffdd5e, argc=3D, argc@entry=3D4, argv=3D, argv@entry=3D0x7fffffffde88) at ../../gcc/toplev.cc:2306 #18 0x0000000000a4d1ef in main (argc=3D4, argv=3D0x7fffffffde88) at ../../gcc/main.cc:39 (gdb) c Continuing. Breakpoint 1, aarch64_sve::function_builder::add_function (this=3D0x7ffffff= fd980, instance=3D..., name=3D0x31d4d20 "svmla_za64_vg4x1", fntype=3D0x7ffff640fe7= 0, attrs=3D0x7ffff64c4aa0, required_extensions=3D5497558138885, overloaded_p= =3Dfalse, placeholder_p=3Dfalse) at ../../gcc/config/aarch64/aarch64-sve-builtins.cc:= 1478 1478 if (t !=3D 0) (gdb) bt #0 aarch64_sve::function_builder::add_function (this=3D0x7fffffffd980, instance=3D..., name=3D0x31d4d20 "svmla_za64_vg4x1", fntype=3D0x7ffff640fe7= 0, attrs=3D0x7ffff64c4aa0, required_extensions=3D5497558138885, overloaded_p= =3Dfalse, placeholder_p=3Dfalse) at ../../gcc/config/aarch64/aarch64-sve-builtins.cc:= 1478 #1 0x00000000017ddd0a in aarch64_sve::function_builder::add_unique_function (this=3D0x7fffffffd980, instance=3D..., return_type=3D0x7ffff7421f18, argument_types=3D..., required_extensions=3D5497558138885, force_direct_overloads=3Dfalse) at ../../gcc/config/aarch64/aarch64-sve-builtins.cc:1549 #2 0x00000000017ef6da in aarch64_sve::build_one (b=3D..., signature=3D, group=3D..., mode_suffix_id=3D, ti=3D, gi=3D, pi=3D0, force_direct_overloads=3Dfalse) at ../../gcc/config/aarch64/aarch64-sve-builtins-shapes.cc:331 #3 0x00000000017ef7f9 in aarch64_sve::build_all (b=3D..., signature=3Dsignature@entry=3D0x263bcd7 "_,su32,t1,t1", group=3D..., mode_suffix_id=3Dmode_suffix_id@entry=3Daarch64_sve::MODE_none, force_direct_overloads=3Dforce_direct_overloads@entry=3Dfalse) at ../../gcc/config/aarch64/aarch64-sve-builtins-shapes.cc:470 #4 0x00000000017f4855 in aarch64_sve::binary_za_slice_opt_single_def::build (this=3D, b=3D..., group=3D...) at ../../gcc/config/aarch64/aarch64-sve-builtins-shapes.cc:1895 #5 0x00000000017de25d in aarch64_sve::function_builder::register_function_group (this=3D0x7fffffffd9= 80, group=3D...) at ../../gcc/config/aarch64/aarch64-sve-builtins.cc:1644 #6 0x00000000017e771b in aarch64_sve::handle_arm_sve_h () at ../../gcc/config/aarch64/aarch64-sve-builtins.cc:4595 #7 0x0000000000da3d75 in aarch64_pragma_aarch64 () at ../../gcc/config/aarch64/aarch64-c.cc:347 #8 0x0000000000bf022f in cp_parser_pragma (parser=3D0x7ffff73409d8, context=3Dpragma_external, if_p=3D0x0) at ../../gcc/cp/parser.cc:50751 #9 0x0000000000c2c2ac in cp_parser_toplevel_declaration (parser=3D0x7ffff73409d8) at ../../gcc/cp/parser.cc:15392 #10 cp_parser_toplevel_declaration (parser=3D0x7ffff73409d8) at ../../gcc/cp/parser.cc:15383 #11 cp_parser_translation_unit (parser=3D0x7ffff73409d8) at ../../gcc/cp/parser.cc:5273 #12 c_parse_file () at ../../gcc/cp/parser.cc:50845 #13 0x0000000000d741d2 in c_common_parse_file () at ../../gcc/c-family/c-opts.cc:1301 #14 0x000000000133917e in compile_file () at ../../gcc/toplev.cc:446 #15 0x0000000000a4b151 in do_compile () at ../../gcc/toplev.cc:2150 #16 toplev::main (this=3Dthis@entry=3D0x7fffffffdd5e, argc=3D, argc@entry=3D4, argv=3D, argv@entry=3D0x7fffffffde88) at ../../gcc/toplev.cc:2306 #17 0x0000000000a4d1ef in main (argc=3D4, argv=3D0x7fffffffde88) at ../../gcc/main.cc:39 ``` I used this small patch to debug it: ``` diff --git a/gcc/config/aarch64/aarch64-sve-builtins.cc b/gcc/config/aarch64/aarch64-sve-builtins.cc index 15fa5907de5..4f285f47750 100644 --- a/gcc/config/aarch64/aarch64-sve-builtins.cc +++ b/gcc/config/aarch64/aarch64-sve-builtins.cc @@ -1472,6 +1472,13 @@ function_builder::add_function (const function_insta= nce &instance, { unsigned int code =3D vec_safe_length (registered_functions); code =3D (code << AARCH64_BUILTIN_SHIFT) | AARCH64_BUILTIN_SVE; + if (strcmp (name, "svmla_za64_vg4x1") =3D=3D 0) + { + static int t =3D 0; + if (t !=3D 0) + gcc_unreachable(); + t++; + } /* We need to be able to generate placeholders to enusre that we have a consistent numbering scheme for function codes between the C and C++ ```=