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 debug/96690] [10/11 Regression] ICE in write_type since r10-6087
Date: Mon, 24 Aug 2020 11:34:15 +0000	[thread overview]
Message-ID: <bug-96690-4-87OtYxCHqx@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-96690-4@http.gcc.gnu.org/bugzilla/>

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |debug
           Keywords|                            |ice-on-valid-code

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Hmm, but we're pushing TYPE_MAIN_VARIANT ().  The issue seems to be that
we're mangling 'foo' via rtl_for_decl_init () which is the init of
a template value, &foo, that is only required from debug and FLD does not
walk those template trees we eventually generate this debug from.

That said, we're expecting to have mangled everything we have to eventually
mangle at the time FLD runs but here we're mangling things after the fact.

IMHO the template paramter DIE should have a more symbolic representation
and not use relocations to say 'foo'.  Trying to bypass rtl_for_decl_init
via

diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 9deca031fc2..4d652e594ad 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -19764,6 +19793,9 @@ reference_to_unused (tree * tp, int * walk_subtrees,
       if (!node || !node->definition)
        return *tp;
     }
+  else if (TREE_CODE (*tp) == FUNCTION_DECL
+          && !DECL_ASSEMBLER_NAME_SET_P (*tp))
+    return *tp;
   else if (TREE_CODE (*tp) == FUNCTION_DECL
           && (!DECL_EXTERNAL (*tp) || DECL_DECLARED_INLINE_P (*tp)))
     {

turns this into the very same issue via

0xfe0d36 cst_pool_loc_descr
        ../../src/gcc/gcc/dwarf2out.c:17485
0xfe21e9 loc_list_from_tree_1
        ../../src/gcc/gcc/dwarf2out.c:18305
0xfe4823 loc_list_from_tree
        ../../src/gcc/gcc/dwarf2out.c:19042
0xfe4881 loc_descriptor_from_tree
        ../../src/gcc/gcc/dwarf2out.c:19055
0xffb29d gen_remaining_tmpl_value_param_die_attribute
        ../../src/gcc/gcc/dwarf2out.c:27168

where loc_list_from_tree_1 doesn't seem to have the same "protection"
against referencing unused symbols as rtl_for_decl_init has.

Note without -flto we do not appear to output a DIE refering to 'foo'.

  parent reply	other threads:[~2020-08-24 11:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-18 20:03 [Bug c++/96690] New: " jakub at gcc dot gnu.org
2020-08-18 20:12 ` [Bug c++/96690] " jakub at gcc dot gnu.org
2020-08-18 20:13 ` jakub at gcc dot gnu.org
2020-08-18 20:14 ` mpolacek at gcc dot gnu.org
2020-08-24 11:34 ` rguenth at gcc dot gnu.org [this message]
2020-08-24 11:51 ` [Bug debug/96690] " rguenth at gcc dot gnu.org
2020-08-24 11:58 ` jakub at gcc dot gnu.org
2020-08-24 12:20 ` rguenth at gcc dot gnu.org
2020-08-25  7:06 ` cvs-commit at gcc dot gnu.org
2020-08-25  7:06 ` [Bug debug/96690] [10 " rguenth at gcc dot gnu.org
2020-09-15  8:23 ` cvs-commit at gcc dot gnu.org
2020-09-15  8:24 ` rguenth at gcc dot gnu.org

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-96690-4-87OtYxCHqx@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).