From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E1334385829D; Fri, 15 Mar 2024 22:25:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E1334385829D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1710541510; bh=Yg3uZTnFghjAZZHLJAYTxBwjw/fBPj98lbe9PY6BKyA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=HBHwd04J5dmG+lOQNp5lc7qH0tKgoYOYpoHMSbgmShzi+Jk3E16Yuc408+aElNdNG rNR/LVy+QhYrlxrRtkKIttoP23mtK0iK69r72ynd9LPAHkiUWHeqsu6ioKqLQq2S0G XReEqwuo/4dqWnVSqM7Fg1JmJTVfgmcLOluHjJvQ= From: "jfb at chromium dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/114357] Add a way to not call deconstructors for non-auto decls, like clang's no_destroy attribute Date: Fri, 15 Mar 2024 22:25:10 +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: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: jfb at chromium dot 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: 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=3D114357 --- Comment #5 from JF Bastien --- (In reply to Andrew Pinski from comment #4) > (In reply to JF Bastien from comment #3) > > The LLVM feature was added for XNU, because the kernel never runs its o= wn > > global C++ destructors (but the compiler can't know this). It saved a > > non-trivial amount of code generation. >=20 > Yes and that is broken .... Please substantiate your assertion with evidence. What, specifically, is br= oken and why? It's totally normal for kernels to not run destructors. It's totally normal= for classes to have destructors and do work in them. It's totally normal to use these classes as globals and not need the destructor behavior in these glob= al circumstances (yet need it when used on the stack or heap). It's totally no= rmal for the compiler to not know this unless told. Look you can do what you want with a non-standard feature in GCC. You're ju= st not being constructive (being destructive?) in this request. People have us= ed this for good reasons in my opinion, and more people would want this standardized so I'll revive that standardization effort. If you have actual good reasons to be against I'd like to hear them. I haven't heard those rea= sons from you. But again, do what you want and feel free to ignore, I'm not goin= g to engage further if you want to just close the bug as "won't fix".=