From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 19ED93858C2D; Wed, 19 Oct 2022 11:38:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 19ED93858C2D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666179494; bh=sMaRzQRr/UA/of63BV0EJfO6+Z5Tuz7c/gurRf33BRc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=GFOpaGW8i7rYHMYlyYaOqlOpHYH/LlocBDUk8taZVbLLedaQbae6/DHvEiIB3ECcj JFGjRcnWqoNmlUHZO8gucFhyUKj1YdehzkffZv5N6S+D53nzjhP1/o/8ywgSfimX+i Gzo3dYwnC6gi8JO7xDYyAppvrK1SWdM6XnIIir+o= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107282] ICE on valid code template + overloaded + visit Date: Wed, 19 Oct 2022 11:38:10 +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: 13.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: 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=3D107282 --- Comment #5 from Richard Biener --- So we are late processing (rest_of_handle_final) dwaf2out_decl of copyLifeS= tate and there iterating the scope vars which include a TYPE_DECL ._anon_2 here for which we generate a type DIE because 27023 if (is_redundant_typedef (decl)) 27024 gen_type_die (TREE_TYPE (decl), context_die); but the type was already generated early and there will be no way to refer to just the type late (or TYPE_DECLs in practice from LTO). diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc index e81044b8c48..090465a4896 100644 --- a/gcc/dwarf2out.cc +++ b/gcc/dwarf2out.cc @@ -27021,7 +27021,10 @@ gen_decl_die (tree decl, tree origin, struct vlr_context *ctx, break; if (is_redundant_typedef (decl)) - gen_type_die (TREE_TYPE (decl), context_die); + { + if (early_dwarf) + gen_type_die (TREE_TYPE (decl), context_die); + } else /* Output a DIE to represent the typedef itself. */ gen_typedef_die (decl, context_die); fixes this, but I'm not sure it isn't barking up the wrong tree given the bisection - but that should only end up emitting more debug early and not affect what we do late.=