From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id ABBB73858D35; Wed, 30 Jun 2021 06:43:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ABBB73858D35 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/101266] ICE with -g: in loc_list_from_tree_1, at dwarf2out.c:19421 Date: Wed, 30 Jun 2021 06:43:05 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth 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: component everconfirmed version cf_reconfirmed_on bug_status 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 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: Wed, 30 Jun 2021 06:43:05 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101266 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Component|debug |c Ever confirmed|0 |1 Version|tree-ssa |12.0 Last reconfirmed| |2021-06-30 Status|UNCONFIRMED |NEW --- Comment #1 from Richard Biener --- Confirmed. We hit #1 0x0000000000d898e5 in loc_list_from_tree_1 (loc=3D , want_address=3D0, context=3D0x0) at /home/rguenther/src/gcc2/gcc/dwarf2out.c:19421 19421 gcc_unreachable (); (gdb) l 19416 } 19417 19418 /* Otherwise this is a generic code; we should just lists all= of 19419 these explicitly. We forgot one. */ 19420 if (flag_checking) 19421 gcc_unreachable (); (gdb) p loc $1 =3D (gdb) p debug_generic_expr (loc) <<< Unknown tree: compound_literal_expr int D.1943 =3D 1; >>> and the original tree we ask for is (long int) SAVE_EXPR <<<< Unknown tree: compound_literal_expr int D.1943 =3D 1; >>>> + -1 this looks like some missed DECL_EXPR / gimplification or a missed error. clang complains: > clang-9 t.c -S t.c:1:9: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] typedef U; ~~~~~~~ ^ t.c:2:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] fn8(U (*)[(int){1}]) {} ^ t.c:2:9: error: parameter name omitted fn8(U (*)[(int){1}]) {} ^ 2 warnings and 1 error generated. but adding a parameter name doesn't fix anything. Note we call dwarf2out_decl via #14 0x0000000000d9f4f4 in dwarf2out_type_decl ( decl=3D, local=3D0) at /home/rguenther/src/gcc2/gcc/dwarf2out.c:27099 #15 0x000000000120699d in rest_of_decl_compilation ( decl=3D, top_level=3D1, at_end=3D0) at /home/rguenther/src/gcc2/gcc/passes.c:251 #16 0x0000000000a614a7 in finish_decl (decl=3D,=20 init_loc=3D246464, init=3D, origtype=3D,=20 asmspec_tree=3D) at /home/rguenther/src/gcc2/gcc/c/c-decl.c:5= 606 #17 0x0000000000a65c38 in grokdeclarator (declarator=3D0x385b320,=20 declspecs=3D0x385b170, decl_context=3DPARM, initialized=3Dfalse, width= =3D0x0,=20 decl_attrs=3D0x7fffffffd628, expr=3D0x7fffffffd648,=20 expr_const_operands=3D0x7fffffffd49f, deprecated_state=3DDEPRECATED_NOR= MAL) at /home/rguenther/src/gcc2/gcc/c/c-decl.c:7171 so this is before any gimplification happened.=