From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A730A3858C52; Thu, 19 Jan 2023 13:58:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A730A3858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674136718; bh=wbGc4WKz14bDa130ZRNjtfd4XWLMF8oOAL2UEEyTIlo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=JaqKsDWdQ4JuRY/CJThcfSHwT1SQaPk+9jOszdxMQXEhzVzfr6a9k9Hx7h9AAwOkl 0PEK6cHefGWrZQCETp+TKkFkwWdow5GFPAweHpPvEYq9Z7y+Akbibao/RTOGehxXKV 8OAI4XeW5OVFJR2iCGBksnvarizfIvKtBUulFTcw= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/53932] [10/11/12/13 Regression] C++ reference variable to member of anonymous union in global is error Date: Thu, 19 Jan 2023 13:58:37 +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: 4.3.4 X-Bugzilla-Keywords: assemble-failure, ice-on-valid-code, link-failure, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc keywords 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=3D53932 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at gcc dot gnu.org Keywords| |wrong-code --- Comment #6 from Richard Biener --- The C++ frontend mangles union { int i; }; .local _ZL1i .comm _ZL1i,4,4 but not the reference to the anonymous union member: .globl r .data .align 8 .type r, @object .size r, 8 r: .quad i they are even different decls: i/3 (int i) Type: variable Body removed by symtab_remove_unreachable_nodes Visibility: semantic_interposition artificial References: Referring: r/1 (addr) Availability: not_available Varpool flags: r/1 (int& r) Type: variable definition analyzed Visibility: force_output externally_visible semantic_interposition no_reo= rder asm_written public Aux: @0x1 References: i/3 (addr) Referring: Availability: available Varpool flags: initialized read-only const-value-known _ZL1i/0 (_ZL1i) Type: variable definition analyzed Visibility: force_output semantic_interposition no_reorder prevailing_def_ironly asm_written Aux: @0x7ffff7ff3100 References: Referring: Availability: available Varpool flags:=