From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6580B3857B9D; Wed, 19 Oct 2022 13:00:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6580B3857B9D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666184438; bh=3LFjJpJWmtd7tnpzwuvA1jSlTAMBvPaZFf5azvyLBi0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=suRtA8yz6w0Z86BFWBGtfRSxKSNZELJYyaPUYGzZtfiBl9VkLG5o7htGT5DnSn7Es 336AfL+zy2dqtjwFzv19fozzc5YRLsUCxEOH0Nu/cQpjUQE1daUAklfhztygZZhCwk EB/MfEGhL2D4fvn/F9m8OygPnuD+RHKAx6IiHZto= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/107206] Bogus -Wuninitialized in std::optional Date: Wed, 19 Oct 2022 12:59:59 +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: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit 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=3D107206 --- Comment #7 from CVS Commits --- The master branch has been updated by Martin Jambor : https://gcc.gnu.org/g:f6c168f8c06047bfaa3005e570126831b8855dcc commit r13-3378-gf6c168f8c06047bfaa3005e570126831b8855dcc Author: Martin Jambor Date: Wed Oct 19 14:43:04 2022 +0200 SRA: Limit replacement creation for accesses propagated from LHSs PR 107206 is fallout from the fix to PR 92706 where we started propagating accesses across assignments also from LHS to RHS of assignments so that we would not do harmful total scalarization of the aggregates on the RHS. But this can lead to new scalarization of these aggregates and in the testcase of PR 107206 these can appear in superfluous uses of un-initialized values and spurious warnings. Fixed by making sure the the accesses created by propagation in this direction are only used as a basis for replacements when the structure would be totally scalarized anyway. gcc/ChangeLog: 2022-10-18 Martin Jambor PR tree-optimization/107206 * tree-sra.cc (struct access): New field grp_result_of_prop_from_lhs. (analyze_access_subtree): Do not create replacements for access= es with this flag when not toally scalarizing. (propagate_subaccesses_from_lhs): Set the new flag. gcc/testsuite/ChangeLog: 2022-10-18 Martin Jambor PR tree-optimization/107206 * g++.dg/tree-ssa/pr107206.C: New test.=