From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6CF063858D35; Tue, 23 May 2023 16:48:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6CF063858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684860509; bh=hu/oxHKroXlSvz/iFc8ERE6QxaFyBzmWuA17m1eXMAw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=CXz7htcRJLOZsxJyZGzzQt2dCENr39k3cQI9oGodFN/WBiPcm3ahz07Rqbvq1hp8Y qUWTOXKTNVfFsGli1EsFrlSbnaUUyPaLwy4PySTXb2NgrgKtFNRgPoW4l3lECiMspH olXmCBRtKhepG/5ictrMNr4rtHeMmwEZP9xe6VCI= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/109945] Escape analysis hates copy elision: different result with -O1 vs -O2 Date: Tue, 23 May 2023 16:48:29 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc cf_known_to_fail 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=3D109945 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at gcc dot gnu.org Known to fail|4.1.2, 4.5.3, 4.7.4, 4.9.0 | --- Comment #4 from Richard Biener --- The testcase is very related to the old PR and shows the issue manifests it= self also for !TYPE_NEEDS_CONSTRUCTING types. I wonder whether we need a CTOR at all here to show the issue. I also wonder how we can query whether the type has a CTOR (as opposed to "needs" one). The function type is unit-size align:32 warn_if_not_align:0 symtab:0 alias-set 2 canonical-type 0x7ffff6fdef18 fields public abstract external autoinline decl_3 QI t.ii:1:8 align:16 warn_if_not_align:0 context full-name "Widget::~Widget() noexcept ()" not-really-extern chain > context full-name "struct Widget" needs-constructor X() X(constX&) this=3D(X&) n_parents=3D0 use_temp= late=3D0 interface-unknown pointer_to_this reference_to_this chain > so the type has TYPE_NEEDS_CONSTRUCTING set but it isn't TREE_ADDRESSABLE.=