From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1121F3858C35; Sat, 16 Mar 2024 23:18:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1121F3858C35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1710631131; bh=31QhmsKzARblCKjeyHBJAHCpXkE87m8WkRGt0yul4Qs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=OgVYYAC3LCys247/QhEfXr4et2ctjTa/skYOkqxi7FylkQOgjm0IPUIqyckLGwLwV QemrthuJFWm/YJRV5y1UwavHmZKQ3hbYPKIm+VZU1qC9QOM/4p4HbxXVytUH8H01J4 zyFIx0CaPYCVrLRQtTJcOZIlRHJV8g8/YgbRNRZI= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109268] Guard variable still provided for static constinit variable with an empty destructor Date: Sat, 16 Mar 2024 23:18:49 +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: 13.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: DUPLICATE 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: everconfirmed cf_reconfirmed_on bug_status resolution 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=3D109268 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Last reconfirmed| |2024-03-16 Status|UNCONFIRMED |NEW Status|NEW |RESOLVED Resolution|--- |DUPLICATE --- Comment #3 from Andrew Pinski --- I have a patch which fixes PR 19661 except it does not fix this one fully. I will also note LLVM also still does the guard variable here too even with= the removal of the __cxa_atexit call. We need another way to remove the empty code between __cxa_guard_acquire/__cxa_guard_release . [local count: 354334800]: _2 =3D __cxa_guard_acquire (&_ZGVZ1fvE4data); if (_2 !=3D 0) goto ; [33.00%] else goto ; [67.00%] [local count: 116930483]: # DEBUG this =3D> &data # DEBUG INLINE_ENTRY __ct=20 data =3D{v} {CLOBBER(bob)}; # DEBUG this =3D> NULL __cxa_guard_release (&_ZGVZ1fvE4data); [local count: 1073741824]: --- Comment #4 from Andrew Pinski --- Dup in the end. *** This bug has been marked as a duplicate of bug 84411 ***=