From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8E58F3858D32; Mon, 17 Oct 2022 13:10:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8E58F3858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666012231; bh=Wo88cGOXdE75Nw8/ZbTO3CyjoJUhQZqjZwxlGj3bt4Q=; h=From:To:Subject:Date:In-Reply-To:References:From; b=qgV+6TTBzywJbQC42Mmntl+l3Ffdcw42ElPe+oQzSNRSve59g2g4bnePjJ8JYuzuL q3pHjEw/BprMUMB994RQm8U+0DDq9Jo68p9y5yfvtk4Cp3D1pXy20m20JxHGJ8a+T+ +kZBRGB3jlszrOo74wjeAlZbUbAc8NvPKQ1q7MBY= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/106922] [12 Regression] Bogus uninitialized warning on boost::optional<>>, missed FRE Date: Mon, 17 Oct 2022 13:10: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.2.1 X-Bugzilla-Keywords: diagnostic, missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.3 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=3D106922 --- Comment #28 from CVS Commits --- The releases/gcc-12 branch has been updated by Richard Biener : https://gcc.gnu.org/g:e8d5f3a1b5a5839cb1db57d6f6766469cc4f8747 commit r12-8835-ge8d5f3a1b5a5839cb1db57d6f6766469cc4f8747 Author: Richard Biener Date: Wed Sep 21 13:52:56 2022 +0200 tree-optimization/106922 - missed FRE/PRE The following enhances the store-with-same-value trick in vn_reference_lookup_3 by not only looking for a =3D val; *ptr =3D val; .. =3D a; but also *ptr =3D val; other =3D x; .. =3D a; where the earlier store is more than one hop away. It does this by queueing the actual value to compare until after the walk but as disadvantage only allows a single such skipped store from a constant value. Unfortunately we cannot handle defs from non-constants this way since we're prone to pick up values from the past loop iteration this way and we have no good way to identify values that are invariant in the currently iterated cycle. That's why we keep the single-hop lookup for those cases. gcc.dg/tree-ssa/pr87126.c would be a testcase that's un-XFAILed when we'd handle those as well. PR tree-optimization/106922 * tree-ssa-sccvn.cc (vn_walk_cb_data::same_val): New member. (vn_walk_cb_data::finish): Perform delayed verification of a skipped may-alias. (vn_reference_lookup_pieces): Likewise. (vn_reference_lookup): Likewise. (vn_reference_lookup_3): When skipping stores of the same value also handle constant stores that are more than a single VDEF away by delaying the verification. * gcc.dg/tree-ssa/ssa-fre-100.c: New testcase. * g++.dg/tree-ssa/pr106922.C: Adjust. (cherry picked from commit 9baee6181b4e427e0b5ba417e51424c15858dce7)=