From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F10CB3865493; Thu, 20 Aug 2020 10:08:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F10CB3865493 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1597918084; bh=hc7qhgeL8MUJ67SS6ljgdgN/qU5J+4XAf9S0FXgMKGU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Gg8mRq75qmjxSqvIfweboqG3HGbHX3N/Qk1xQ7x4Jd7bx2jIDt8mRAN+QuipuWpmC RS0XAgYykFSMVAUgN/W9r5ysu/AhqyDPNHkxxuNnliinl1KwvDiF/rHEHXcNvgGlPC qT/h6WYZG8nRPIUVDdix5UMuIRa443/UhCdF6RTI= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/96721] [11 Regression] pseudo-destructor calls on pointers since r11-2238 Date: Thu, 20 Aug 2020 10:08:04 +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: 11.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.0 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 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, 20 Aug 2020 10:08:05 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96721 --- Comment #2 from Jakub Jelinek --- build_trivial_dtor_call has: if (INDIRECT_TYPE_P (TREE_TYPE (instance))) { if (VOID_TYPE_P (TREE_TYPE (TREE_TYPE (instance)))) goto no_clobber; instance =3D cp_build_fold_indirect_ref (instance); } so, either we adjust the caller such that for TYPE_PTR_P types it passes an address of the instance rather than the instance itself, or we add an argum= ent (perhaps defaulted bool) to build_trivial_dtor_call that inhibits this beha= vior for TYPE_PTR_P, or drop this if completely and adjust any caller that calls= it with a pointer or reference and expects it to destruct what it points to ra= ther than itself.=