From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1BFA83857702; Wed, 24 May 2023 09:00:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1BFA83857702 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684918855; bh=bxO+DGoahH7D3sgR4l8Dahzux4LkBvg4s9YfddIThDE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=oXTUz+Sg5x0T7KMVBSXsiIwlY809LGl/Ys9wKw4gzM3lDulho4X74L4GZKdnGciNR PjnsuXVsKA6ZLh1lYUTLcjxPGzJcckT+u+O7drj7lCTmxgNPosVBrNZetjZjIjPY3t nFFThTHPqaYzgesvin/II31G0OpX6HtUQPFZHetU= From: "jakub 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: Wed, 24 May 2023 09:00:54 +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: jakub 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: 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 --- Comment #18 from Jakub Jelinek --- We'd need the FE to note it somewhere (of course, if it is indirect call or= the call doesn't bind to the definition we'd need to assume it might be with mandatory NRV). I think in the C++ FE it is finalized in finalize_nrv, but which one is mandatory and which one is just that the FE does it because it is allowed t= o, no idea. Plus, not really sure if it would be valid to rely on it the way the testca= se does if it is not mandatory. Jason?=