public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.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	[thread overview]
Message-ID: <bug-107282-4-RjTFDiC6HV@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-107282-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107282

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
So we are late processing (rest_of_handle_final) dwaf2out_decl of copyLifeState
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.

      parent reply	other threads:[~2022-10-19 11:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-16 23:07 [Bug c++/107282] New: " boris_oncev at hotmail dot com
2022-10-17 11:51 ` [Bug c++/107282] " marxin at gcc dot gnu.org
2022-10-17 12:08 ` marxin at gcc dot gnu.org
2022-10-18 13:31 ` ppalka at gcc dot gnu.org
2022-10-18 16:55 ` marxin at gcc dot gnu.org
2022-10-19 11:38 ` rguenth at gcc dot gnu.org [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-107282-4-RjTFDiC6HV@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).