From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 23376385C017; Thu, 19 Mar 2020 12:33:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 23376385C017 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1584621224; bh=CmcvvY7YcEiwYX5NAywj4oqnUh0tg718jIRbhOaKmE0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=i4lnmFjmtD8fLoT3cSVZdKfckmP/kwS9wI5zFBZVI+n9nwaHSE3k8ySc8gKe48Yx0 7z8Z7IWgda1s/wsp/34W0eScgblH8uAKJUja6qhVgTUejsQOFzSpp5kgLktp9yqE8W Oz0qhKw+lZbym38MLvv26JKfUfjjEW/EuNpc4ucY= From: "jakub at gcc dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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: cc 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: Thu, 19 Mar 2020 12:33:44 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94223 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #1 from Jakub Jelinek --- gimplify.c does: 4941 if (!DECL_NAME (object)) 4942 DECL_NAME (object) =3D create_tmp_var_name ("C"); 4943 walk_tree (&DECL_INITIAL (object), force_labels_r, NULL, NULL); 4944=20=20=20=20 4945 /* ??? C++ doesn't automatically append a . 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, wh= ich aren't 4950 "local" in the object file sense. So in order to ge= t 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 =3D IDENTIFIER_POINTER (DECL_NAME (decl)); 170 char *label; 171=20=20=20=20=20 172 ASM_FORMAT_PRIVATE_NAME (label, name, DECL_UID (decl)); 173 id =3D 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?=