From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E88433858D20; Tue, 5 Mar 2024 15:17:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E88433858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709651838; bh=5DBRQLhrYu84kLeQ427yCcZQdbgdoFxOHMuEWcNdFMw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=a1Bga0DbX9XvYY8C91vRaZBxJN68qJRzfsnMSV1k1MjrWCId8Tz3Y1ndsDNsHBJ9B Re4m1mk9/6u++Xh6hxlxiVHqfegKMGF2STBi3QCHQbnx7X4ley62q65mPFdQV+FUoP uKsOeRTyJ9zRkxPSiSjNXGs35KN48v3v7+4o7CLo= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/114236] introduce unnecessary store operation when unrolling a loop Date: Tue, 05 Mar 2024 15:17:18 +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: 13.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: WONTFIX 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: bug_status resolution cc 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=3D114236 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |WONTFIX CC| |rguenth at gcc dot gnu.org --- Comment #1 from Richard Biener --- Executing store motion of MEM[(short int *)&g_16] from loop 2 Re-issueing dependent store of *g_70.2_4 from loop 2 on exit 4 -> 5 Moving statement The extra store is required to enable sinking of the store to g_16 as we don't know whether g_70 points to aliased memory. I think we fail to realize that *g_70 is loop invariant as well, but what you observe is a feature - it allows reducing the number of stores to g_16.=