From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C4CA23858D28; Tue, 20 Feb 2024 11:53:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C4CA23858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1708430027; bh=aNSkL4DEI2j0dLSu4tnObkz+z6lCpVYaZ/flM+V2U2Y=; h=From:To:Subject:Date:In-Reply-To:References:From; b=sebXHmvgbbz+rvwc1+AJRaYzyO0e3jVHLWHXISxtOj8/RCZz9biHuU/RkXVWKpUX+ q8Xd246xQh3cctKXeLcYMnSplHBNfuSHO5N8C2iQ6GgtchbdTGwHw0nHamtdYMl2er /R5pHS4WMemRXQ9sF4Uz8KKsSGjJj2ehd4xmnyMQ= 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: Tue, 20 Feb 2024 11:53:47 +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: NEW 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=3D109945 --- Comment #24 from Jakub Jelinek --- On the #c23 testcase, actually even on i686-linux where it is passed in mem= ory we optimize main at -O2 -m32 -fno-strict-aliasing -fno-tree-pta (i.e. when = the code mentioned in #c12 is never called) to return 1; - it is SRA which optimizes that because w isn't TREE_ADDRESSABLE on the caller side. So we'd also need to treat such return values as TREE_ADDRESSABLE.=