From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3D6D83857C75; Thu, 21 Oct 2021 08:20:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3D6D83857C75 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/102864] no out of bounds warning for DCE code Date: Thu, 21 Oct 2021 08:20: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: 12.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: enhancement X-Bugzilla-Who: cvs-commit 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: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Oct 2021 08:20:29 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102864 --- Comment #2 from CVS Commits --- The trunk branch has been updated by Andrew Pinski : https://gcc.gnu.org/g:113860301f46d14a255bd947d18d36f917527230 commit r12-4598-g113860301f46d14a255bd947d18d36f917527230 Author: Andrew Pinski Date: Sat Oct 16 04:14:57 2021 +0000 Improve maybe_remove_writeonly_store to do a simple DCE for defining statement Instead of putting a full blow DCE after execute_fixup_cfg, it makes se= nse to try to remove the defining statement for the store that is being removed. Using simple_dce_from_worklist makes this easier, just mark the ssa_nam= e on the rhs side of the store (if it was one) in a bitmap and then call simple_dce_from_worklist at the end. gcc.dg/pr36902.c needed to be changed such that the static array was no longer a static array but a global array. This is because this new dce will remove the load as it is dead. I also filed PR 102864 for the warn= ing on dead loads. gcc/ChangeLog: * tree-cfg.c (maybe_remove_writeonly_store): Add dce_ssa_names argument. Mark the ssa-name of the rhs as one to be removed. (execute_fixup_cfg): Update call to maybe_remove_writeonly_stor= e. Call simple_dce_from_worklist at the end to a simple dce. gcc/testsuite/ChangeLog: * gcc.dg/pr36902.c: Move buf to be a non-static variable.=