public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/94223] [10 Regression] -fcompare-debug -O0 failure on cpp1z/init-statement6.C
Date: Thu, 19 Mar 2020 12:33:43 +0000	[thread overview]
Message-ID: <bug-94223-4-9qyHC0S91u@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-94223-4@http.gcc.gnu.org/bugzilla/>

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
gimplify.c does:
4941                if (!DECL_NAME (object))
4942                  DECL_NAME (object) = create_tmp_var_name ("C");
4943                walk_tree (&DECL_INITIAL (object), force_labels_r, NULL,
NULL);
4944    
4945                /* ??? C++ doesn't automatically append a .<number> to the
4946                   assembler name, and even when it does, it looks at FE
private
4947                   data structures to figure out what that number should
be,
4948                   which are not set for this variable.  I suppose this is
4949                   important for local statics for inline functions, which
aren't
4950                   "local" in the object file sense.  So in order to get a
unique
4951                   TU-local symbol, we must invoke the lhd version now.  */
4952                lhd_set_decl_assembler_name (object);

and lhd_set_decl_assembler_name does:
169           const char *name = IDENTIFIER_POINTER (DECL_NAME (decl));
170           char *label;
171     
172           ASM_FORMAT_PRIVATE_NAME (label, name, DECL_UID (decl));
173           id = get_identifier (label);

The problem is that DECL_UID isn't stable across -fcompare-debug, we only
guarantee that the comparisons of the DECL_UIDs are the same between
corresponding decls, but -g can have larger gaps.

grep ASM_FORMAT_PRIVATE_NAME.*DECL_UID * */* config/*/* 2>/dev/null
langhooks.c:      ASM_FORMAT_PRIVATE_NAME (label, name, DECL_UID (decl));
d/decl.cc:  ASM_FORMAT_PRIVATE_NAME (label, name, DECL_UID (decl));
lto/lto-lang.c:      ASM_FORMAT_PRIVATE_NAME (label, name, DECL_UID (decl));

Not sure what to do, shall we have some GTY counter used for these instead of
DECL_UID which we'd bump when we've done this?

  reply	other threads:[~2020-03-19 12:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-19 11:49 [Bug c++/94223] New: " zhroma at gcc dot gnu.org
2020-03-19 12:33 ` jakub at gcc dot gnu.org [this message]
2020-03-20  8:41 ` [Bug c++/94223] " rguenth at gcc dot gnu.org
2020-03-20  8:47 ` jakub at gcc dot gnu.org
2020-03-20 11:47 ` rguenth at gcc dot gnu.org
2020-03-24 15:09 ` jakub at gcc dot gnu.org
2020-03-25  8:19 ` cvs-commit at gcc dot gnu.org
2020-03-25  8:23 ` jakub 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-94223-4-9qyHC0S91u@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).