From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 362FC3858C66; Sat, 3 Jun 2023 00:23:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 362FC3858C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685751783; bh=sqbDxc8eg3kAAWCM+Oh+C9+tKDEeswfWz+BngDsUCJk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Bw2sAUkWqo+3h8kZrNUOsJ4agunAW9RPMP7wOAW+Jk7K3JsneYvVdf9l7rtAIp4mZ cMJrEKAghyK2zZ4YHFK/lsxKaBcPdbRgtts662sPfg/1miCAW0wsYXpLE8D16NtjgM /of11RUnGGDA/ZtG24++tbvboA2NVb2g5xGpU0eQ= From: "ptk.prasertsuk at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110035] Missed optimization for dependent assignment statements Date: Sat, 03 Jun 2023 00:23:02 +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: 12.1.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: ptk.prasertsuk at gmail dot com 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=3D110035 --- Comment #7 from Pontakorn Prasertsuk = --- For the LLVM IR code of the snippet I provided, Clang's alias analysis can prove that `new` call has no side effect to other memory location. This is indicated by `noalias` keyword at the return value of the `new` call (_Znwm= ). According to Clang's Language Reference: "On function return values, the noalias attribute indicates that the functi= on acts like a system memory allocation function, returning a pointer to alloc= ated storage disjoint from the storage for any other object accessible to the caller." Is this possible for GCC alias analysis pass?=